Skip to content

Commit

Permalink
Merge pull request #669 from ChaosPredictor/dev
Browse files Browse the repository at this point in the history
2 new tests: accurate/approx markers only
  • Loading branch information
danielhers authored Feb 27, 2017
2 parents 303f91b + d6e5f47 commit 9c79b58
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,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')
Expand Down

0 comments on commit 9c79b58

Please sign in to comment.