improve exempt decorator test

This commit is contained in:
Reuben Thomas-Davis
2020-07-11 21:56:44 +01:00
parent 6580bb0624
commit cd79c35a39
2 changed files with 7 additions and 2 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.pytest_cache
__pycache__
# editors
.idea

View File

@@ -190,7 +190,7 @@ class TestDecorators(TestSlowapi):
return PlainTextResponse("test")
with TestClient(app) as cli:
resp = cli.get("/t2", headers={"X_FORWARDED_FOR": "127.0.0.11"})
resp = cli.get("/t2", headers={"X_FORWARDED_FOR": "127.0.0.10"})
assert resp.status_code == 200
resp2 = cli.get("/t2", headers={"X_FORWARDED_FOR": "127.0.0.11"})
resp2 = cli.get("/t2", headers={"X_FORWARDED_FOR": "127.0.0.10"})
assert resp2.status_code == 200