From c1194b9b65a33e2f47735cbc6cedcbc443f618ac Mon Sep 17 00:00:00 2001 From: Jay07GIT Date: Mon, 25 Sep 2023 18:53:48 +0530 Subject: [PATCH] resolved func tests --- .../tests/recordsets/get_recordset_test.py | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/modules/api/src/test/functional/tests/recordsets/get_recordset_test.py b/modules/api/src/test/functional/tests/recordsets/get_recordset_test.py index de879a851..bb2d314c0 100644 --- a/modules/api/src/test/functional/tests/recordsets/get_recordset_test.py +++ b/modules/api/src/test/functional/tests/recordsets/get_recordset_test.py @@ -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 @