Skip to content

Commit

Permalink
fix: Functional tests must run on localhost to work in Windows (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanathkr authored and jfuss committed Jul 17, 2018
1 parent 007ab16 commit bc59a39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class TestFunctionalLocalLambda(TestCase):

def setUp(self):
self.host = "0.0.0.0"
self.host = "127.0.0.1"
self.port = random.randint(30000, 40000) # get a random port
self.url = "http://{}:{}".format(self.host, self.port)

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/local/apigw/test_local_apigw_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ def make_service(list_of_routes, function_provider, cwd):
service = LocalApigwService(list_of_routes, lambda_runner, port=port)

scheme = "http"
url = '{}://0.0.0.0:{}'.format(scheme, port)
url = '{}://127.0.0.1:{}'.format(scheme, port)
return service, port, url, scheme


Expand All @@ -647,7 +647,7 @@ def make_service_response(port, method, scheme, resourcePath, resolvedResourcePa
for header, value in headers.items():
response["headers"][header] = value

response["headers"]["Host"] = "0.0.0.0:{}".format(port)
response["headers"]["Host"] = "127.0.0.1:{}".format(port)
response["headers"]["X-Forwarded-Port"] = str(port)
response["headers"]["X-Forwarded-Proto"] = scheme

Expand Down

0 comments on commit bc59a39

Please sign in to comment.