Skip to content

Commit

Permalink
add test to cover optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Psotta committed Feb 6, 2021
1 parent 07265e5 commit c4193f3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test_directions.py
Expand Up @@ -48,6 +48,24 @@ def test_directions(self):
self.assertEqual(resp, self.valid_query)
self.assertIn("sample_key", responses.calls[0].request.headers.values())

@responses.activate
def test_directions_incompatible_parameters(self):
self.valid_query["optimized"] = True
responses.add(
responses.POST,
"https://api.openrouteservice.org/v2/directions/{}/geojson".format(
self.valid_query["profile"]
),
json=self.valid_query,
status=200,
content_type="application/json",
)

resp = self.client.directions(**self.valid_query)

self.assertEqual(resp, self.valid_query)
self.assertIn("sample_key", responses.calls[0].request.headers.values())

def test_format_out_deprecation(self):
bad_query = deepcopy(self.valid_query)
bad_query["format_out"] = "json"
Expand Down

0 comments on commit c4193f3

Please sign in to comment.