diff --git a/tests/test_flask.py b/tests/test_flask.py index 08b16041c..f85f65d68 100644 --- a/tests/test_flask.py +++ b/tests/test_flask.py @@ -95,6 +95,26 @@ def test_markers_light_only_response(self): for i in range(0,len(resp['markers'])): self.assertEqual(resp['markers'][i]['severity'], 3) + def test_markers_accurate_only(self): + rv = self.app.get("/markers?ne_lat=32.082754580757744&ne_lng=34.79886274337764&sw_lat=32.072645555012734&sw_lng=34.77712612152095&zoom=16&thin_markers=false&start_date=1104537600&end_date=1485129600&show_fatal=1&show_severe=1&show_light=1&approx=&accurate=1&show_markers=1&show_discussions=1&show_urban=3&show_intersection=3&show_lane=3&show_day=7&show_holiday=0&show_time=24&start_time=25&end_time=25&weather=0&road=0&separation=0&surface=0&acctype=0&controlmeasure=0&district=0&case_type=0") + self.assertEqual(rv.status, '200 OK') + #print(rv.data) + resp = json.loads(rv.data) + self.assertIn('markers', resp) + #self.assertEqual(len(resp['markers']), 16) + for i in range(0,len(resp['markers'])): + self.assertEqual(resp['markers'][i]['locationAccuracy'], 1) + + def test_markers_approx_only(self): + rv = self.app.get("/markers?ne_lat=32.082754580757744&ne_lng=34.79886274337764&sw_lat=32.072645555012734&sw_lng=34.77712612152095&zoom=16&thin_markers=false&start_date=1104537600&end_date=1485129600&show_fatal=1&show_severe=1&show_light=1&approx=1&accurate=&show_markers=1&show_discussions=1&show_urban=3&show_intersection=3&show_lane=3&show_day=7&show_holiday=0&show_time=24&start_time=25&end_time=25&weather=0&road=0&separation=0&surface=0&acctype=0&controlmeasure=0&district=0&case_type=0") + self.assertEqual(rv.status, '200 OK') + #print(rv.data) + resp = json.loads(rv.data) + self.assertIn('markers', resp) + #self.assertEqual(len(resp['markers']), 16) + for i in range(0,len(resp['markers'])): + self.assertTrue(resp['markers'][i]['locationAccuracy'] in (2,3)) + def test_clusters(self): rv = self.app.get("/clusters?ne_lat=34.430273343405844&ne_lng=44.643749999999955&sw_lat=28.84061194106889&sw_lng=22.385449218749955&zoom=6&thin_markers=true&start_date=1104537600&end_date=1486944000&show_fatal=1&show_severe=1&show_light=1&approx=1&accurate=1&show_markers=&show_discussions=1&show_urban=3&show_intersection=3&show_lane=3&show_day=7&show_holiday=0&show_time=24&start_time=25&end_time=25&weather=0&road=0&separation=0&surface=0&acctype=0&controlmeasure=0&district=0&case_type=0") self.assertEqual(rv.status, '200 OK')