aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_application.py
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2023-03-27 22:46:44 +0100
committerTomasz Kramkowski <tomasz@kramkow.ski>2023-03-27 22:46:44 +0100
commit77889ec30410280ef1ec1671b6226a8d0c0444f7 (patch)
treeb6f371ee6838b179681dc101c8c32b0ed088fe41 /tests/test_application.py
parent3a9629e49b4c7e1d10c89bbffa04d18e96948116 (diff)
downloadpaste-77889ec30410280ef1ec1671b6226a8d0c0444f7.tar.gz
paste-77889ec30410280ef1ec1671b6226a8d0c0444f7.tar.xz
paste-77889ec30410280ef1ec1671b6226a8d0c0444f7.zip
Throw all data manipulation code in one place
This means that everything now goes through a Store object, which should make testing a little bit easier.
Diffstat (limited to 'tests/test_application.py')
-rw-r--r--tests/test_application.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_application.py b/tests/test_application.py
index 5a7847e..e86d937 100644
--- a/tests/test_application.py
+++ b/tests/test_application.py
@@ -4,6 +4,7 @@ import pytest
from webtest import TestApp
import paste.db
+import paste.store
from paste import __main__, application
DB = "file::memory:?cache=shared"
@@ -11,7 +12,7 @@ DB = "file::memory:?cache=shared"
@pytest.fixture
def db():
- with paste.db.connect(DB) as d:
+ with paste.store.open(DB) as d:
yield d
@@ -24,7 +25,7 @@ def app(db):
@pytest.fixture
def token(db):
- return b64encode(__main__.generate_token(db)).decode()
+ return b64encode(db.generate_token()).decode()
@pytest.mark.parametrize("method", ["put", "post", "delete"])
@@ -229,7 +230,6 @@ def test_delete(app, token):
)
assert res.status == "201 Created"
assert res.headers["Location"] == res.request.url
- etag = res.headers["ETag"]
res = app.delete("/test_key", expect_errors=True)
assert res.status == "401 Unauthorized"
res = app.delete("/test_key", headers={"Authorization": f"APIKey {token}"})