mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-08-30 22:05:21 +00:00
Update func tests
Signed-off-by: Nicholas Spadaccino <nicholas_spadaccino@comcast.com>
This commit is contained in:
@@ -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):
|
||||
"""
|
||||
|
@@ -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")))
|
||||
|
Reference in New Issue
Block a user