diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2023-03-27 23:09:25 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2023-03-27 23:09:25 +0100 |
commit | f1bba1369b7bd3836fd6e38cf1a3c4d7844feee5 (patch) | |
tree | c9a57d8fcf3c8b12565c90a3bac0a737c7c2dc7a | |
parent | fcac7b8ccb64730017ece9ca4ffb73d923536226 (diff) | |
download | paste-f1bba1369b7bd3836fd6e38cf1a3c4d7844feee5.tar.gz paste-f1bba1369b7bd3836fd6e38cf1a3c4d7844feee5.tar.xz paste-f1bba1369b7bd3836fd6e38cf1a3c4d7844feee5.zip |
rename open_database to open_store
-rw-r--r-- | paste/__init__.py | 4 | ||||
-rw-r--r-- | tests/middleware/test_open_store.py (renamed from tests/middleware/test_open_database.py) | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/paste/__init__.py b/paste/__init__.py index 0f75587..099474a 100644 --- a/paste/__init__.py +++ b/paste/__init__.py @@ -151,7 +151,7 @@ def options(app: App, environ: Env, start_response: StartResponse) -> Response: @middleware -def open_database(app: App, environ: Env, start_response: StartResponse) -> Response: +def open_store(app: App, environ: Env, start_response: StartResponse) -> Response: db_path = environ.get("PASTE_DB", DB_PATH) with store.open(db_path) as stor: environ["paste.store"] = stor @@ -186,7 +186,7 @@ def authenticate(app: App, environ: Env, start_response: StartResponse) -> Respo @validate_method @options @if_none_match -@open_database +@open_store @authenticate def application(environ: Env, start_response: StartResponse) -> Response: stor = environ["paste.store"] diff --git a/tests/middleware/test_open_database.py b/tests/middleware/test_open_store.py index 769c04e..dd430e9 100644 --- a/tests/middleware/test_open_database.py +++ b/tests/middleware/test_open_store.py @@ -1,12 +1,12 @@ from contextlib import contextmanager from wsgiref.validate import validator -from paste import open_database +from paste import open_store from ..common_wsgi import call_app -def test_open_database(monkeypatch): +def test_open_store(monkeypatch): db_path = "test_db_path" store = object() @@ -16,7 +16,7 @@ def test_open_database(monkeypatch): yield store @validator - @open_database + @open_store @validator def app(environ, start_response): assert "paste.store" in environ |