File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11def selectionMain (row ):
22 # this should be used to remove lines from data frame, so should return true or false
3- return "foo"
3+ return "foo"
4+
Original file line number Diff line number Diff line change 1010
1111
1212
13+
Original file line number Diff line number Diff line change @@ -16,4 +16,10 @@ def transformationTestingWithApply(cell):
1616
1717def columnBHandling (cell ):
1818 result = cell - 5
19- return result
19+ return result
20+
21+
22+ def transformFoo ():
23+ return "something"
24+
25+ # REAL FUNCTIONS BELOW THIS FILE
Original file line number Diff line number Diff line change 22import urllib .request
33import time
44from bs4 import BeautifulSoup
5+
6+ import tools
57# INSTRUCTIONS
68# Mocking https://docs.python.org/3/library/unittest.mock-examples.html
79# google: python unittest mock tutorial
1820# example: conda create -n env-01 python=3.8.2
1921
2022def getData ():
23+ temp = tools .tools .laughing ()
2124 # url = 'http://web.mta.info/developers/turnstile.html'
2225 url = 'http://api.worldbank.org/v2/country/all/indicator/SP.POP.TOTL?format=json'
2326 response = requests .get (url ) # task: mock this function. if applicable use with your own data source (URL)
Original file line number Diff line number Diff line change 1212from example_pkg import bar_func
1313from dataTransforming import transformationForData
1414from dataTransforming import transformationTestingWithApply
15+ from dataTransforming import transformFoo
1516
1617from functools import reduce
1718import pandas as pd
2021url = 'http://api.worldbank.org/v2/country/all/indicator/SP.POP.TOTL?format=json'
2122
2223class TestMethods_live (unittest .TestCase ):
24+ def test_transformation (self ):
25+ # call to function changing some "global" data structure
26+ # assert function is checking that the change you expected happens properly.
27+ result = transformFoo ()
28+ self .assertEqual ("foo" , result )
29+ self .assertEqual (awesome .smile (), ":)" )
30+
2331 def test_assertion_1 (self ):
2432 # call to function changing some "global" data structure
2533 # assert function is checking that the change you expected happens properly.
Original file line number Diff line number Diff line change 1+ '''
2+ This is a package called dataTransforming (a folder name)
3+ Instructions: to this file import source code files (modules) one by one.
4+ When using functions do not mention source code files (modules), only functions inside those source code files.
5+ Example on how to import function from this package
6+ from dataTransforming import transformationForData
7+ '''
8+
9+ from .tools import *
10+
11+
12+
13+
14+
Original file line number Diff line number Diff line change 1+
2+ def laughing ():
3+ return ":D"
4+
5+ def laughingPara (parastring ):
6+ return ":D" + parastring
You can’t perform that action at this time.
0 commit comments