@@ -13,10 +13,23 @@ def test_import_random():
1313def test_for_functon_existence (capsys , app ):
1414 assert callable (app .century )
1515
16- @pytest .mark .it ('We tried to pass 1801 as parameter and it did not return 19!' )
16+ @pytest .mark .it ('The function must return something' )
17+ def test_function_return (capsys , app ):
18+ assert app .century (19001 ) != None
19+
20+ @pytest .mark .it ('The function must return a number' )
21+ def test_function_return_type (capsys , app ):
22+ assert type (app .century (19001 )) == type (1 )
23+
24+ @pytest .mark .it ('We tried to pass 2000 as parameter and it did not return 20!' )
1725def test_for_file_output (capsys , app ):
18- if app .century (1801 ) % 100 == 0 :
19- assert app .century (1801 ) == math .floor (1801 / 100 )
20- else :
21- assert app .century (1801 ) == math .floor (1801 / 100 + 1 )
26+ assert app .century (2000 ) == 20
27+
28+ @pytest .mark .it ('We tried to pass 2000 as parameter and it did not return 21!' )
29+ def test_for_file_output2 (capsys , app ):
30+ assert app .century (2001 ) == 21
31+
32+ @pytest .mark .it ('We tried to pass 2000 as parameter and it did not return 21!' )
33+ def test_for_file_output3 (capsys , app ):
34+ assert app .century (2101 ) == 22
2235
0 commit comments