def test_resulting_map(): """Does the resulting map display correctly?""" client = app.test_client() app.testing = True response = client.post('/get_distance.html', data={'origin': 'EWR', 'destination': 'LAX'}) as_text = response.get_data() assert 'LatLng(39.4442535904, -97.3351527597)' in as_text assert 'LatLng (33.942536, -118.408075)' in as_text assert '(40.6925, -74.168667)' in as_text
def test_completions(): """Do completions for a given term get returned correctly?""" client = app.test_client() app.testing = True response = client.get('/completions?term=lax') assert json.loads(response.get_data()) == [{"value": "LAX", "label": "Los Angeles Intl (LAX)"}]
def test_default_route(): """Can we successfully load the form page?""" client = app.test_client() app.testing = True response = client.get('/') assert 'Airport Distance' in response.get_data()