From a627f17e0b3d0cba78ab18eb3d5d3d03d8b7ea5d Mon Sep 17 00:00:00 2001 From: Jake Herrmann Date: Thu, 19 Oct 2023 14:36:33 -0800 Subject: [PATCH] Use keyword arguments for `set_cookie` --- tests/test_api/conftest.py | 6 +++++- tests/test_api/test_api_spec.py | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/test_api/conftest.py b/tests/test_api/conftest.py index 3aa65b8f0..464c68cb5 100644 --- a/tests/test_api/conftest.py +++ b/tests/test_api/conftest.py @@ -24,7 +24,11 @@ def client(): def login(client, username=DEFAULT_USERNAME): - client.set_cookie('localhost', AUTH_COOKIE, auth.get_mock_jwt_cookie(username, lifetime_in_seconds=10_000)) + client.set_cookie( + domain='localhost', + key=AUTH_COOKIE, + value=auth.get_mock_jwt_cookie(username, lifetime_in_seconds=10_000) + ) def make_job(granules=None, name='someName', job_type='RTC_GAMMA', parameters=None): diff --git a/tests/test_api/test_api_spec.py b/tests/test_api/test_api_spec.py index 20d45630f..027b7e60e 100644 --- a/tests/test_api/test_api_spec.py +++ b/tests/test_api/test_api_spec.py @@ -38,14 +38,22 @@ def test_not_logged_in(client): def test_invalid_cookie(client): for uri in ENDPOINTS: - client.set_cookie('localhost', AUTH_COOKIE, 'garbage I say!!! GARGBAGE!!!') + client.set_cookie( + domain='localhost', + key=AUTH_COOKIE, + value='garbage I say!!! GARGBAGE!!!' + ) response = client.get(uri) assert response.status_code == HTTPStatus.UNAUTHORIZED def test_expired_cookie(client): for uri in ENDPOINTS: - client.set_cookie('localhost', AUTH_COOKIE, auth.get_mock_jwt_cookie('user', lifetime_in_seconds=-1)) + client.set_cookie( + domain='localhost', + key=AUTH_COOKIE, + value=auth.get_mock_jwt_cookie('user', lifetime_in_seconds=-1) + ) response = client.get(uri) assert response.status_code == HTTPStatus.UNAUTHORIZED