@@ -136,7 +136,7 @@ pytest -v -k questionnaire_unit_test.py -s
136136In the same idea as Level 7 with fixtures, it is possible to call the built-in methods ` setUpClass ` and ` tearDownClass `
137137at the beginning and at the end of the tests of the class. To do this, the ` self ` argument must be modified to ` cls `
138138because these built-in functions are private to the unittest class, and the built-in ` @classmethod ` tag must be added
139- over the class in order to access them.
139+ over the class in order to force the access to them.
140140
141141---
142142### Level 9 : Tests with a patch on network requests
@@ -148,22 +148,22 @@ It should so better to simulate the answers of the network requests like ``Succe
148148or `` File Not Found (404) `` for example, to get the best knowledge of the program behavior.
149149
150150This may require to rewrite the tests because the reading of the file from URL must also be simulated, like in this 2
151- tests trying to read files from a non-existent URL of the Web.
151+ tests trying to read files from a non-existent Web URL .
152152
153- - ` test_01 ` -> ` None, File_Path ` if receives __ a json file on a non-existent URL with a simulated `` File Not Found (404) `` answer to
154- the network request__ then prints the message :
153+ - ` test_01 ` -> ` None, File_Path ` if receives __ a json file on a non-existent Web URL with a simulated
154+ `` File Not Found (404) `` answer to the network request__ then prints the message :
155155``` commandline
156156questionnaire.py http://non-existent-url.com/initial_json_test_file.json -> None, File_Path
157157Error : File not found at URL http://non-existent-url.com/initial_json_test_file.json
158158```
159- - ` test_02 ` -> ` Json_Data, File_Path ` if receives __ a json file on a non-existent URL with a simulated `` Success (200) `` answer to the
160- network request__ then prints no message.
159+ - ` test_02 ` -> ` Json_Data, File_Path ` if receives __ a json file on a non-existent Web URL with a simulated
160+ `` Success (200) `` answer to the network request__ then prints no message.
161161``` commandline
162162questionnaire.py http://non-existent-url.com/initial_json_test_file.json -> Json_Data, File_Path
163163```
164164In that case, the property ` status_code ` of the response must be updated to the code ` 200 (OK) ` and the property ` text `
165- of the response must contain the read json data. This is simulated by the reading of a file from the given path without
166- the server part `` ./initial_json_test_file.json ``
165+ of the response must contain the read json data. This is simulated by the reading of a local file from the given path
166+ without the server part like `` ./initial_json_test_file.json `` in this example.
167167
168168---
169169### Level 10 : Json Tests
0 commit comments