def test_autocomplete_stations_withEmptySys(self): query = "term=&system=" response = server.handleStationQuery(query) self.assertEqual(20, len(json.loads(response)))
def test_autocomplete_stations_withWrongSys(self): query = "term=Sylv&system=Nixda" response = server.handleStationQuery(query) expected = '[{"systemId": 4615, "systemName": "Eravate", "data": 232, "value": "Sylvester City", "label": "Sylvester City (Eravate)"}]' self.assertEqual(expected, response)
def test_autocomplete_stations_broad(self): query = "term=eng" response = server.handleStationQuery(query) expected = '[{"systemId": 4615, "systemName": "Eravate", "data": 47747, "value": "Linenger\'s Inheritance", "label": "Linenger\'s Inheritance (Eravate)"}, {"systemId": 4857, "systemName": "Frigaha", "data": 406, "value": "Engle Orbital", "label": "Engle Orbital (Frigaha)"}]' self.assertEqual(expected, response)