Now, we will write additional unit tests to improve the testing coverage. Specifically, we will write unit tests related to the hexacopter motor and the altimeter.
Open the tests.py file in the root folder for the virtual environment (Tornado01). Insert the following lines after the last line. The code file for the sample is included in the restful_python_2_11_02 folder, in the Django01/tests.py file:
async def
test_set_and_get_hexacopter_motor_speed(http_server_client): """ Ensure we can set and get the hexacopter's motor speed """ patch_args = {'motor_speed_in_rpm': 200} patch_response = await http_server_client.fetch( '/hexacopters/1', method='PATCH', body=json.dumps(patch_args)) assert patch_response.code == HTTPStatus.OK ...