aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_application.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_application.py')
-rw-r--r--tests/test_application.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_application.py b/tests/test_application.py
index a7d6861..5a7847e 100644
--- a/tests/test_application.py
+++ b/tests/test_application.py
@@ -238,3 +238,20 @@ def test_delete(app, token):
"/test_key", headers={"Authorization": f"APIKey {token}"}, expect_errors=True
)
assert res.status == "404 Not Found"
+
+
+def test_post(app, token):
+ res = app.post(
+ "/test_key",
+ "Hello, World!",
+ headers={"Content-Type": "text/plain", "Authorization": f"APIKey {token}"},
+ )
+ assert res.status == "201 Created"
+ assert res.headers["Location"] != res.request.url
+ print(res.headers["Location"])
+ print(res.request.url)
+ assert res.headers["Location"].startswith(res.request.url)
+ etag = res.headers["ETag"]
+ res = app.get(res.headers["Location"])
+ assert res.status == "200 OK"
+ assert res.headers["ETag"] == etag