diff --git a/tests/test_parser.py b/tests/test_parser.py index ef3a94e..5fa3914 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -58,7 +58,16 @@ def test_autnum_response_parser(self): 'type': 'entity', 'whois_server': 'whois.arin.net', 'name': 'Cloudflare, Inc.', - 'rir': 'arin' + 'rir': 'arin', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -72,7 +81,16 @@ def test_autnum_response_parser(self): 'name': 'Abuse', 'email': 'abuse@cloudflare.com', 'tel': '+1-650-319-8930', - 'rir': 'arin' + 'rir': 'arin', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -86,7 +104,16 @@ def test_autnum_response_parser(self): 'name': 'NOC', 'email': 'noc@cloudflare.com', 'tel': '+1-650-319-8930', - 'rir': 'arin' + 'rir': 'arin', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -100,7 +127,16 @@ def test_autnum_response_parser(self): 'name': 'Admin', 'email': 'rir@cloudflare.com', 'tel': '+1-650-319-8930', - 'rir': 'arin' + 'rir': 'arin', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -176,7 +212,16 @@ def test_domain_response_parser(self): 'url': 'https://rdap.norid.no/entity/reg42-NORID', 'type': 'entity', 'name': 'Domeneshop AS', - 'email': 'kundeservice@domeneshop.no' + 'email': 'kundeservice@domeneshop.no', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': 'Christian Krohgs gate 16', + 'locality': 'Oslo', + 'region': '', + 'postal_code': 'NO-0186', + 'country': 'NORWAY', + } } ] ) @@ -187,7 +232,16 @@ def test_domain_response_parser(self): 'url': 'https://rdap.norid.no/entity/DH21326R-NORID', 'type': 'entity', 'name': 'Domeneshop Hostmaster', - 'email': 'hostmaster@domeneshop.no' + 'email': 'hostmaster@domeneshop.no', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': 'NORWAY', + } } ] ) @@ -210,7 +264,7 @@ def test_domain_response_parser(self): { 'handle': '1647', 'type': 'entity', - 'name': 'Hosting Concepts B.V. d/b/a Registrar.eu', + 'name': 'Hosting Concepts B.V. d/b/a Registrar.eu' } ] ) @@ -255,7 +309,16 @@ def test_ip_response_parser(self): 'name': 'APNIC RESEARCH', 'email': 'research@apnic.net', 'tel': '+61-7-3858-3199', - 'rir': 'apnic' + 'rir': 'apnic', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -315,7 +378,16 @@ def test_ip_response_parser(self): 'name': 'APNIC RESEARCH', 'email': 'research@apnic.net', 'tel': '+61-7-3858-3199', - 'rir': 'apnic' + 'rir': 'apnic', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -348,7 +420,16 @@ def test_ip_response_parser(self): 'rir': 'arin', 'type': 'entity', 'url': 'https://rdap.arin.net/registry/entity/GOGL', - 'whois_server': 'whois.arin.net' + 'whois_server': 'whois.arin.net', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -362,7 +443,16 @@ def test_ip_response_parser(self): 'type': 'entity', 'url': 'https://rdap.arin.net/registry/entity/ZG39-ARIN', 'tel': '+1-650-253-0000', - 'whois_server': 'whois.arin.net' + 'whois_server': 'whois.arin.net', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -376,7 +466,16 @@ def test_ip_response_parser(self): 'type': 'entity', 'url': 'https://rdap.arin.net/registry/entity/ZG39-ARIN', 'tel': '+1-650-253-0000', - 'whois_server': 'whois.arin.net' + 'whois_server': 'whois.arin.net', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -390,7 +489,16 @@ def test_ip_response_parser(self): 'name': 'Abuse', 'email': 'network-abuse@google.com', 'tel': '+1-650-253-0000', - 'rir': 'arin' + 'rir': 'arin', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } }, { 'handle': 'ZG39-ARIN', @@ -400,7 +508,16 @@ def test_ip_response_parser(self): 'name': 'Google LLC', 'email': 'arin-contact@google.com', 'tel': '+1-650-253-0000', - 'rir': 'arin' + 'rir': 'arin', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -432,7 +549,16 @@ def test_ip_response_parser(self): 'rir': 'arin', 'type': 'entity', 'url': 'https://rdap.arin.net/registry/entity/GOGL', - 'whois_server': 'whois.arin.net' + 'whois_server': 'whois.arin.net', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) @@ -464,7 +590,16 @@ def test_entity_response_parser(self): 'type': 'entity', 'url': 'https://rdap.arin.net/registry/entity/GTS7-ARIN', 'tel': '+1-519-254-5115', - 'whois_server': 'whois.arin.net' + 'whois_server': 'whois.arin.net', + 'address': { + 'po_box': '', + 'ext_address': '', + 'street_address': '', + 'locality': '', + 'region': '', + 'postal_code': '', + 'country': '', + } } ] ) diff --git a/tests/test_public_interface.py b/tests/test_public_interface.py index 4b2678d..21a7630 100644 --- a/tests/test_public_interface.py +++ b/tests/test_public_interface.py @@ -91,6 +91,17 @@ def test_domain_interface_1(self): ) self.assertTrue(isinstance(resp["entities"]["registrar"], list)) self.assertTrue(len(resp["entities"]["registrar"]) > 0) + self.assertTrue(isinstance(resp["entities"]["registrant"], list)) + self.assertTrue(len(resp["entities"]["registrant"]) > 0) + self.assertEqual(resp["entities"]["registrant"][0]['address'], { + 'country': "US", + 'ext_address': '', + 'locality': '', + 'po_box': '', + 'postal_code': '', + 'region': 'CA', + 'street_address': '', + }) @responses.activate # @_recorder.record(file_path=RESPONSES / 'ip-v4-1.yaml') @@ -314,6 +325,17 @@ async def test_domain_interface_1(self): ) self.assertTrue(isinstance(resp["entities"]["registrar"], list)) self.assertTrue(len(resp["entities"]["registrar"]) > 0) + self.assertTrue(isinstance(resp["entities"]["registrant"], list)) + self.assertTrue(len(resp["entities"]["registrant"]) > 0) + self.assertEqual(resp["entities"]["registrant"][0]['address'], { + 'country': "US", + 'ext_address': '', + 'locality': '', + 'po_box': '', + 'postal_code': '', + 'region': 'CA', + 'street_address': '', + }) @pytest.mark.asyncio @pytest.mark.usefixtures("mock_httpx")