Beispiel #1
0
 def test_no_attributes(self):
     response_dict = {
         "data": [{
                 "test": True
         }]
     }
     final_output = process_response(response_dict)
     self.assertEqual("KeyError when processing json response: {'data': [{'test': True}]}", final_output)
Beispiel #2
0
 def test_no_data(self):
     response_dict = {
         "meta": {
             "test": True
         }
     }
     final_output = process_response(response_dict)
     self.assertEqual("KeyError when processing json response: {'meta': {'test': True}}", final_output)
Beispiel #3
0
 def test_valid_response(self):
     response_dict = self.get_test_file('test_files/response_valid.json')
     [output_str, output_list] = process_response(response_dict)
     expected_long_names = ['Red Line', 'Orange Line']
     expected_routes = ['Red', 'Orange']
     for route in expected_long_names:
         self.assertIn(route, output_str)
     for route in expected_routes:
         self.assertIn(route, output_list)
Beispiel #4
0
 def test_no_response(self):
     response_dict = {}
     final_output = process_response(response_dict)
     self.assertEqual(final_output, 'No response body to process')
Beispiel #5
0
 def test_no_long_name(self):
     response_dict = self.get_test_file('test_files/response_invalid.json')
     final_output = process_response(response_dict)
     self.assertIn("KeyError when processing json response:", final_output)