unittests passing on windows again

This commit is contained in:
Alec Buckenheimer
2018-09-29 13:54:47 -04:00
parent 076cf51fb2
commit efbacc17cf
10 changed files with 264 additions and 224 deletions

View File

@@ -165,12 +165,13 @@ def test_route_optional_slash(app):
request, response = app.test_client.get('/get/')
assert response.text == 'OK'
def test_route_strict_slashes_set_to_false_and_host_is_a_list(app):
#Part of regression test for issue #1120
# Part of regression test for issue #1120
site1 = 'localhost:{}'.format(app.test_client.port)
site1 = '127.0.0.1:{}'.format(app.test_client.port)
#before fix, this raises a RouteExists error
# before fix, this raises a RouteExists error
@app.get('/get', host=[site1, 'site2.com'], strict_slashes=False)
def handler(request):
return text('OK')
@@ -178,25 +179,25 @@ def test_route_strict_slashes_set_to_false_and_host_is_a_list(app):
request, response = app.test_client.get('http://' + site1 + '/get')
assert response.text == 'OK'
@app.post('/post', host=[site1, 'site2.com'], strict_slashes=False)
@app.post('/post', host=[site1, 'site2.com'], strict_slashes=False) # noqa
def handler(request):
return text('OK')
request, response = app.test_client.post('http://' + site1 +'/post')
request, response = app.test_client.post('http://' + site1 + '/post')
assert response.text == 'OK'
@app.put('/put', host=[site1, 'site2.com'], strict_slashes=False)
@app.put('/put', host=[site1, 'site2.com'], strict_slashes=False) # noqa
def handler(request):
return text('OK')
request, response = app.test_client.put('http://' + site1 +'/put')
request, response = app.test_client.put('http://' + site1 + '/put')
assert response.text == 'OK'
@app.delete('/delete', host=[site1, 'site2.com'], strict_slashes=False)
@app.delete('/delete', host=[site1, 'site2.com'], strict_slashes=False) # noqa
def handler(request):
return text('OK')
request, response = app.test_client.delete('http://' + site1 +'/delete')
request, response = app.test_client.delete('http://' + site1 + '/delete')
assert response.text == 'OK'
def test_shorthand_routes_post(app):