aboutsummaryrefslogtreecommitdiffstats
path: root/tests/middleware
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2023-03-28 18:57:40 +0100
committerTomasz Kramkowski <tomasz@kramkow.ski>2023-03-28 20:10:48 +0100
commit3f1d9361497c4e0803f3dc3ea9cee9d3a4087171 (patch)
treeaee85f3a9858638482389b1a7118e7d4dd0cc863 /tests/middleware
parentd198fca95919cc78275d3d9fa8f1b0a8acfdbab3 (diff)
downloadpaste-3f1d9361497c4e0803f3dc3ea9cee9d3a4087171.tar.gz
paste-3f1d9361497c4e0803f3dc3ea9cee9d3a4087171.tar.xz
paste-3f1d9361497c4e0803f3dc3ea9cee9d3a4087171.zip
Split Store into Store and Auth
This separates the concerns
Diffstat (limited to 'tests/middleware')
-rw-r--r--tests/middleware/test_authenticate.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/middleware/test_authenticate.py b/tests/middleware/test_authenticate.py
index 9fccb32..73b7ded 100644
--- a/tests/middleware/test_authenticate.py
+++ b/tests/middleware/test_authenticate.py
@@ -69,7 +69,7 @@ class MockConnection:
self.check_token = check_token
-class MockStore:
+class MockAuth:
def __init__(self, c):
assert isinstance(c, MockConnection)
self.conn = c
@@ -95,7 +95,7 @@ def test_authenticate_check_token_fail(app, method, monkeypatch):
"HTTP_AUTHORIZATION": f"APIKey {b64encode(token).decode()}",
}
- monkeypatch.setattr("paste.Store", MockStore)
+ monkeypatch.setattr("paste.Auth", MockAuth)
response = call_app(app, environ)
assert check_token_called
assert response.data == b"401 Unauthorized\n"
@@ -121,7 +121,7 @@ def test_authenticate_check_token_success(app, method, monkeypatch):
"HTTP_AUTHORIZATION": f"APIKey {b64encode(token).decode()}",
}
- monkeypatch.setattr("paste.Store", MockStore)
+ monkeypatch.setattr("paste.Auth", MockAuth)
response = call_app(app, environ)
assert check_token_called
assert response.data == b"Hello, world!"