2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-08-31 14:25:30 +00:00

resolved func tests

This commit is contained in:
Jay07GIT
2023-09-25 18:53:48 +05:30
parent 1d2cd50d15
commit c1194b9b65

View File

@@ -96,6 +96,14 @@ def test_get_recordset_count_status_code(shared_zone_test_context):
client.get_recordset_count(shared_zone_test_context.ok_zone["id"],status=200)
def test_get_recordset_count_error(shared_zone_test_context):
"""
Test getting recordset count for a invalid zoneid should return 404
"""
client = shared_zone_test_context.ok_vinyldns_client
client.get_recordset_count("999",status=404)
@pytest.mark.serial
def test_get_recordset_count_by_zoneid(shared_zone_test_context):
"""
Test getting a recordset with name @
@@ -115,25 +123,25 @@ def test_get_recordset_count_by_zoneid(shared_zone_test_context):
}
]
}
result = client.create_recordset(new_rs, status=202)
result_rs = client.wait_until_recordset_change_status(result, "Complete")["recordSet"]
# Get the recordset we just made and verify
result = client.get_recordset_count(result_rs["zoneId"])
result_rs = result["count"]
assert_that(get_recordset_count, is_(1))
result = client.get_recordset(result_rs["zoneId"], result_rs["id"])
result_recordset_count = client.get_recordset_count(result_rs["zoneId"],status=200)
result_rs = result["recordSet"]
expected_rs = new_rs
expected_rs["name"] = ok_zone["name"]
verify_recordset(result_rs, expected_rs)
assert_that(result_recordset_count, is_({'count': 10}))
finally:
if result_rs:
delete_result = client.delete_recordset(result_rs["zoneId"], result_rs["id"], status=202)
client.wait_until_recordset_change_status(delete_result, "Complete")
def test_get_recordset_count_error(shared_zone_test_context):
"""
Test getting recordset count for a invalid zoneid should return 404
"""
client = shared_zone_test_context.ok_vinyldns_client
client.get_recordset_count("999",status=404)
@pytest.mark.serial
def test_at_get_recordset(shared_zone_test_context):
"""
Test getting a recordset with name @