From 959cd22a36a47e7fb0643a37e77fcd0c664d75cf Mon Sep 17 00:00:00 2001 From: Nicholas Spadaccino Date: Mon, 8 Aug 2022 15:46:00 -0400 Subject: [PATCH] Update func tests Signed-off-by: Nicholas Spadaccino --- .../src/test/functional/tests/zones/get_zone_test.py | 11 ++++++++--- .../test/functional/tests/zones/list_zones_test.py | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/api/src/test/functional/tests/zones/get_zone_test.py b/modules/api/src/test/functional/tests/zones/get_zone_test.py index 2e5ba57ff..0068c2bfa 100644 --- a/modules/api/src/test/functional/tests/zones/get_zone_test.py +++ b/modules/api/src/test/functional/tests/zones/get_zone_test.py @@ -34,12 +34,17 @@ def test_get_zone_shared_by_id_as_owner(shared_zone_test_context): def test_get_zone_shared_by_id_non_owner(shared_zone_test_context): """ - Test get an existing shared zone by id as a zone owner + Test get an existing shared zone by id as a non-zone-owner. Non-owner should have read-only access """ client = shared_zone_test_context.dummy_vinyldns_client + group_name = shared_zone_test_context.shared_record_group["name"] + result = client.get_zone(shared_zone_test_context.shared_zone["id"], status=200) + retrieved = result["zone"] - client.get_zone(shared_zone_test_context.shared_zone["id"], status=403) - + assert_that(retrieved["id"], is_(shared_zone_test_context.shared_zone["id"])) + assert_that(retrieved["adminGroupName"], is_(group_name)) + assert_that(retrieved["shared"], is_(True)) + assert_that(retrieved["accessLevel"], is_("Read")) def test_get_zone_private_by_id_fails_without_access(shared_zone_test_context): """ diff --git a/modules/api/src/test/functional/tests/zones/list_zones_test.py b/modules/api/src/test/functional/tests/zones/list_zones_test.py index 1279f5b2f..2c151cd90 100644 --- a/modules/api/src/test/functional/tests/zones/list_zones_test.py +++ b/modules/api/src/test/functional/tests/zones/list_zones_test.py @@ -178,11 +178,11 @@ def test_list_zones_ignore_access_success(shared_zone_test_context): def test_list_zones_ignore_access_success_with_name_filter(shared_zone_test_context): """ - Test that we can retrieve a list of all zones with a name filter + Test that we can retrieve a list of all zones with a name filter. Should have Read access to shared zone """ result = shared_zone_test_context.list_zones_client.list_zones(name_filter=shared_zone_test_context.shared_zone["name"].rstrip("."), ignore_access=True, status=200) retrieved = result["zones"] assert_that(result["ignoreAccess"], is_(True)) assert_that(retrieved, has_item(has_entry("name", shared_zone_test_context.shared_zone["name"]))) - assert_that(retrieved, has_item(has_entry("accessLevel", "NoAccess"))) + assert_that(retrieved, has_item(has_entry("accessLevel", "Read")))