From a1d1c415f0ffcd5224b318b2efff0c5ed3eb0cd4 Mon Sep 17 00:00:00 2001 From: pdmurray Date: Thu, 14 Mar 2024 16:28:20 -0700 Subject: [PATCH] Add another user journey test for a developer creating an env --- .../tests/user_journeys/test_user_journeys.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/conda-store-server/tests/user_journeys/test_user_journeys.py b/conda-store-server/tests/user_journeys/test_user_journeys.py index f9ae57fdd..097fd5241 100644 --- a/conda-store-server/tests/user_journeys/test_user_journeys.py +++ b/conda-store-server/tests/user_journeys/test_user_journeys.py @@ -47,10 +47,11 @@ def test_admin_user_can_create_environment( def test_admin_login_and_delete_shared_environment( base_url: str, specification_path: str ) -> None: - """Test that a user can login and delete an environment in a shared namespace.""" + """Test that an admin can login and create/delete an env in a shared namespace.""" api = utils.API(base_url=base_url) - # Create a shared namespace; default permissions for namepace/environment */* is admin + # Create a shared namespace; default permissions for namepace/environment + # */* is admin namespace = api.create_namespace().json()["data"]["name"] environment = api.create_environment( namespace, @@ -68,19 +69,21 @@ def test_admin_login_and_delete_shared_environment( ("tests/user_journeys/test_data/simple_environment.yaml"), ], ) -def test_user_login_and_delete_shared_environment( +def test_user_login_and_create_shared_environment( base_url: str, specification_path: str ) -> None: - """Test that a user can login and delete an environment in a shared namespace.""" + """Test that a user can login and create an environment in a shared namespace.""" api = utils.API(base_url=base_url) - # Create a shared namespace; default permissions for namepace/environment */* is admin + + # Create a shared namespace; default permissions for namepace/environment + # */* is admin namespace = api.create_namespace().json()["data"]["name"] dev_api = utils.API( base_url=base_url, token=api.create_token( namespace, - 'editor', + 'developer', ).json()['data']['token'] ) @@ -89,5 +92,5 @@ def test_user_login_and_delete_shared_environment( specification_path, ).json()["data"]["specification"]["name"] - dev_api.delete_environment(namespace, environment) + api.delete_environment(namespace, environment) api.delete_namespace(namespace)