Skip to content

Commit

Permalink
Merge pull request #57 from openaddresses/55-source-proxy-py2
Browse files Browse the repository at this point in the history
Fix proxy URL stuff
  • Loading branch information
iandees authored Sep 3, 2018
2 parents 8652fdd + 75bb2c0 commit 3781558
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/download_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,33 @@ def test_coerces_floats_to_integer(self):

self.assertEqual(43, len(data))

def test_proxy_requests(self):
self.add_fixture_response(
r'http://proxy/\?http://example\.com\?f=json',
'us-mo-columbia/us-mo-columbia-metadata.json',
method='GET',
)
self.add_fixture_response(
r'http://proxy/\?http://example\.com/.*returnCountOnly=true.*',
'us-mo-columbia/us-mo-columbia-count-only.json',
method='GET',
)
self.add_fixture_response(
r'http://proxy/\?http://example\.com/.*returnIdsOnly=true.*',
'us-mo-columbia/us-mo-columbia-ids-only.json',
method='GET',
)
self.add_fixture_response(
r'http://proxy/\?http://example\.com/.*query.*',
'us-mo-columbia/us-mo-columbia-0.json',
method='POST',
)

dump = EsriDumper(self.fake_url, proxy='http://proxy?')
data = list(dump)

self.assertEqual(43, len(data))

def test_handles_timeout_error(self):
self.add_fixture_response(
'.*/\?f=json.*',
Expand Down

0 comments on commit 3781558

Please sign in to comment.