aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/middleware/test_authenticate.py6
-rw-r--r--tests/test_application.py4
2 files changed, 5 insertions, 5 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!"
diff --git a/tests/test_application.py b/tests/test_application.py
index 20cbeac..c250909 100644
--- a/tests/test_application.py
+++ b/tests/test_application.py
@@ -5,7 +5,7 @@ from webtest import TestApp
import paste.db
from paste import __main__, application
-from paste.store import Store
+from paste.store import Auth
DB = "file::memory:?cache=shared"
@@ -25,7 +25,7 @@ def app(db):
@pytest.fixture
def token(db):
- return b64encode(Store(db).generate_token()).decode()
+ return b64encode(Auth(db).generate_token()).decode()
@pytest.mark.parametrize("method", ["put", "post", "delete"])