remove port from ip

This commit is contained in:
Raphael Deem
2017-10-23 21:01:44 -07:00
parent 5bcbc5a337
commit c2191153cf
3 changed files with 35 additions and 4 deletions

View File

@@ -27,6 +27,16 @@ def test_sync():
assert response.text == 'Hello'
def test_remote_address():
app = Sanic('test_text')
@app.route('/')
def handler(request):
return text("{}".format(request.ip))
request, response = app.test_client.get('/')
assert response.text == '127.0.0.1'
def test_text():
app = Sanic('test_text')