From 98f25c51165512936a4fa39b77c6b9f1ca70f506 Mon Sep 17 00:00:00 2001 From: Matthew D'Alonzo Date: Tue, 7 May 2024 12:35:13 -0400 Subject: [PATCH 1/3] Remove bad references in test files There were a few references to proprietary properties in the test cases. Those have been removed. --- tests/test_rpc/test_rpc.py | 4 ++-- .../test_builder/test_uattributesbuilder.py | 8 ++++---- .../test_validate/test_uattributesvalidator.py | 12 ++++++------ tests/test_uri/test_serializer/test_uriserializer.py | 12 ++++++------ tests/test_uri/test_validator/test_urivalidator.py | 4 ++-- tests/test_uuid/test_factory/test_uuidutils.py | 4 ++-- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/test_rpc/test_rpc.py b/tests/test_rpc/test_rpc.py index 0eeb5fc..570e680 100644 --- a/tests/test_rpc/test_rpc.py +++ b/tests/test_rpc/test_rpc.py @@ -44,8 +44,8 @@ def build_source(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.ultifi.gm.com"), - entity=UEntity(name="petapp.ultifi.gm.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.com"), + entity=UEntity(name="petapp.com", version_major=1), resource=UResourceBuilder.for_rpc_request(None), ) diff --git a/tests/test_transport/test_builder/test_uattributesbuilder.py b/tests/test_transport/test_builder/test_uattributesbuilder.py index 026e98f..df2dc90 100644 --- a/tests/test_transport/test_builder/test_uattributesbuilder.py +++ b/tests/test_transport/test_builder/test_uattributesbuilder.py @@ -36,16 +36,16 @@ def build_source(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.ultifi.gm.com"), - entity=UEntity(name="petapp.ultifi.gm.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.com"), + entity=UEntity(name="petapp.com", version_major=1), resource=UResourceBuilder.for_rpc_request(None), ) def build_sink(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.ultifi.gm.com"), - entity=UEntity(name="petapp.ultifi.gm.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.com"), + entity=UEntity(name="petapp.com", version_major=1), resource=UResourceBuilder.for_rpc_response(), ) diff --git a/tests/test_transport/test_validate/test_uattributesvalidator.py b/tests/test_transport/test_validate/test_uattributesvalidator.py index 76ac1d0..f3db9f7 100644 --- a/tests/test_transport/test_validate/test_uattributesvalidator.py +++ b/tests/test_transport/test_validate/test_uattributesvalidator.py @@ -44,16 +44,16 @@ def build_sink(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.ultifi.gm.com"), - entity=UEntity(name="petapp.ultifi.gm.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.com"), + entity=UEntity(name="petapp.com", version_major=1), resource=UResourceBuilder.for_rpc_response(), ) def build_source(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.ultifi.gm.com"), - entity=UEntity(name="petapp.ultifi.gm.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.com"), + entity=UEntity(name="petapp.com", version_major=1), resource=UResourceBuilder.for_rpc_request(None), ) @@ -461,8 +461,8 @@ def test_validating_invalid_sink_attribute(self): def test_validating_valid_sink_attribute(self): uri = UUri( - authority=UAuthority(name="vcu.someVin.veh.ultifi.gm.com"), - entity=UEntity(name="petapp.ultifi.gm.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.com"), + entity=UEntity(name="petapp.com", version_major=1), resource=UResourceBuilder.for_rpc_response(), ) attributes = ( diff --git a/tests/test_uri/test_serializer/test_uriserializer.py b/tests/test_uri/test_serializer/test_uriserializer.py index 8c6c2ef..f095324 100644 --- a/tests/test_uri/test_serializer/test_uriserializer.py +++ b/tests/test_uri/test_serializer/test_uriserializer.py @@ -130,7 +130,7 @@ def test_build_resolved_full_information_compare_with_ipv4(self): ipv4_packed_ip: bytes = socket.inet_pton(socket.AF_INET, ipv4_address) authority: UAuthority = UAuthority( - name="vcu.veh.gm.com", ip=ipv4_packed_ip + name="vcu.veh.com", ip=ipv4_packed_ip ) uuri: UUri = UUri(entity=uentity, resource=uresrc, authority=authority) @@ -141,7 +141,7 @@ def test_build_resolved_full_information_compare_with_ipv4(self): actual_micro_uri: bytes = MicroUriSerializer().serialize(uuri) expected_longuri_given_ipv4_uathority: str = ( - "//vcu.veh.gm.com/core.usubscription/3/SubscriptionChange#Update" + "//vcu.veh.com/core.usubscription/3/SubscriptionChange#Update" ) expected_shorturi_given_ipv4_uathority: str = ( "//192.168.1.100/0/3/32768" @@ -174,7 +174,7 @@ def test_build_resolved_full_information_compare_with_id(self): uentity: UEntity = UEntityFactory.from_proto(service_descriptor) authority: UAuthority = UAuthority( - name="1G1YZ23J9P5800001.veh.gm.com", id=b"1G1YZ23J9P5800001" + name="1G1YZ23J9P5800001.veh.com", id=b"1G1YZ23J9P5800001" ) uuri: UUri = UUri(entity=uentity, resource=uresrc, authority=authority) @@ -185,7 +185,7 @@ def test_build_resolved_full_information_compare_with_id(self): actual_micro_uri: bytes = MicroUriSerializer().serialize(uuri) expected_longuri_given_id_uathority: str = ( - "//1G1YZ23J9P5800001.veh.gm.com/core.usubscription/3/SubscriptionChange#Update" + "//1G1YZ23J9P5800001.veh.com/core.usubscription/3/SubscriptionChange#Update" ) expected_shorturi_given_id_uathority: str = ( "//1G1YZ23J9P5800001/0/3/32768" @@ -220,7 +220,7 @@ def test_build_resolved_full_information_compare_with_ipv6(self): ipv6_packed_ip: bytes = socket.inet_pton(socket.AF_INET6, ipv6_address) authority: UAuthority = UAuthority( - name="vcu.veh.gm.com", ip=ipv6_packed_ip + name="vcu.veh.com", ip=ipv6_packed_ip ) uuri: UUri = UUri(entity=uentity, resource=uresrc, authority=authority) @@ -231,7 +231,7 @@ def test_build_resolved_full_information_compare_with_ipv6(self): actual_micro_uri: bytes = MicroUriSerializer().serialize(uuri) expected_longuri_given_ipv6_uathority: str = ( - "//vcu.veh.gm.com/core.usubscription/3/SubscriptionChange#Update" + "//vcu.veh.com/core.usubscription/3/SubscriptionChange#Update" ) expected_shorturi_given_ipv6_uathority: str = ( "//2001:db8:85a3::8a2e:370:7334/0/3/32768" diff --git a/tests/test_uri/test_validator/test_urivalidator.py b/tests/test_uri/test_validator/test_urivalidator.py index f5131a5..a887576 100644 --- a/tests/test_uri/test_validator/test_urivalidator.py +++ b/tests/test_uri/test_validator/test_urivalidator.py @@ -523,13 +523,13 @@ def test_is_remote_when_authority_is_null(self): # self.assertEqual(authority.number_case(), UAuthority.NumberCase.ID) # def test_is_remote_when_authority_has_name_and_number_set(self): - # authority = UAuthority(name="vcu.veh.gm.com", id=b"hello Jello") + # authority = UAuthority(name="vcu.veh.com", id=b"hello Jello") # self.assertTrue(UriValidator.is_remote(authority)) # self.assertTrue(authority.name is not None) # self.assertEqual(authority.number_case(), UAuthority.NumberCase.ID) # def test_is_remote_when_authority_has_name_and_number_is_not_set(self): - # authority = UAuthority(name="vcu.veh.gm.com") + # authority = UAuthority(name="vcu.veh.com") # self.assertTrue(UriValidator.is_remote(authority)) # self.assertTrue(authority.name is not None) # self.assertEqual(authority.number_case(), UAuthority.NumberCase.NUMBER_NOT_SET) diff --git a/tests/test_uuid/test_factory/test_uuidutils.py b/tests/test_uuid/test_factory/test_uuidutils.py index 1fe0ad4..12a3ee9 100644 --- a/tests/test_uuid/test_factory/test_uuidutils.py +++ b/tests/test_uuid/test_factory/test_uuidutils.py @@ -43,8 +43,8 @@ def create_id(): def build_source(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.ultifi.gm.com"), - entity=UEntity(name="petapp.ultifi.gm.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.com"), + entity=UEntity(name="petapp.com", version_major=1), resource=UResource(name="door", instance="front_left", message="Door"), ) From ec573dcc13c15a1fdaac122c18c69e9283842725 Mon Sep 17 00:00:00 2001 From: Matthew D'Alonzo Date: Tue, 7 May 2024 13:23:50 -0400 Subject: [PATCH 2/3] Change to only remove vendor language --- tests/test_rpc/test_rpc.py | 4 ++-- .../test_builder/test_uattributesbuilder.py | 8 ++++---- .../test_validate/test_uattributesvalidator.py | 12 ++++++------ tests/test_uri/test_serializer/test_uriserializer.py | 12 ++++++------ tests/test_uri/test_validator/test_urivalidator.py | 4 ++-- tests/test_uuid/test_factory/test_uuidutils.py | 4 ++-- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/test_rpc/test_rpc.py b/tests/test_rpc/test_rpc.py index 570e680..dd062f5 100644 --- a/tests/test_rpc/test_rpc.py +++ b/tests/test_rpc/test_rpc.py @@ -44,8 +44,8 @@ def build_source(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.com"), - entity=UEntity(name="petapp.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.steven.gm.com"), + entity=UEntity(name="petapp.steven.gm.com", version_major=1), resource=UResourceBuilder.for_rpc_request(None), ) diff --git a/tests/test_transport/test_builder/test_uattributesbuilder.py b/tests/test_transport/test_builder/test_uattributesbuilder.py index df2dc90..041029a 100644 --- a/tests/test_transport/test_builder/test_uattributesbuilder.py +++ b/tests/test_transport/test_builder/test_uattributesbuilder.py @@ -36,16 +36,16 @@ def build_source(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.com"), - entity=UEntity(name="petapp.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.steven.gm.com"), + entity=UEntity(name="petapp.steven.gm.com", version_major=1), resource=UResourceBuilder.for_rpc_request(None), ) def build_sink(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.com"), - entity=UEntity(name="petapp.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.steven.gm.com"), + entity=UEntity(name="petapp.steven.gm.com", version_major=1), resource=UResourceBuilder.for_rpc_response(), ) diff --git a/tests/test_transport/test_validate/test_uattributesvalidator.py b/tests/test_transport/test_validate/test_uattributesvalidator.py index f3db9f7..d18cc32 100644 --- a/tests/test_transport/test_validate/test_uattributesvalidator.py +++ b/tests/test_transport/test_validate/test_uattributesvalidator.py @@ -44,16 +44,16 @@ def build_sink(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.com"), - entity=UEntity(name="petapp.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.steven.gm.com"), + entity=UEntity(name="petapp.steven.gm.com", version_major=1), resource=UResourceBuilder.for_rpc_response(), ) def build_source(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.com"), - entity=UEntity(name="petapp.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.steven.gm.com"), + entity=UEntity(name="petapp.steven.gm.com", version_major=1), resource=UResourceBuilder.for_rpc_request(None), ) @@ -461,8 +461,8 @@ def test_validating_invalid_sink_attribute(self): def test_validating_valid_sink_attribute(self): uri = UUri( - authority=UAuthority(name="vcu.someVin.veh.com"), - entity=UEntity(name="petapp.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.steven.gm.com"), + entity=UEntity(name="petapp.steven.gm.com", version_major=1), resource=UResourceBuilder.for_rpc_response(), ) attributes = ( diff --git a/tests/test_uri/test_serializer/test_uriserializer.py b/tests/test_uri/test_serializer/test_uriserializer.py index f095324..088cfa9 100644 --- a/tests/test_uri/test_serializer/test_uriserializer.py +++ b/tests/test_uri/test_serializer/test_uriserializer.py @@ -130,7 +130,7 @@ def test_build_resolved_full_information_compare_with_ipv4(self): ipv4_packed_ip: bytes = socket.inet_pton(socket.AF_INET, ipv4_address) authority: UAuthority = UAuthority( - name="vcu.veh.com", ip=ipv4_packed_ip + name="vcu.veh.steven.gm.com", ip=ipv4_packed_ip ) uuri: UUri = UUri(entity=uentity, resource=uresrc, authority=authority) @@ -141,7 +141,7 @@ def test_build_resolved_full_information_compare_with_ipv4(self): actual_micro_uri: bytes = MicroUriSerializer().serialize(uuri) expected_longuri_given_ipv4_uathority: str = ( - "//vcu.veh.com/core.usubscription/3/SubscriptionChange#Update" + "//vcu.veh.steven.gm.com/core.usubscription/3/SubscriptionChange#Update" ) expected_shorturi_given_ipv4_uathority: str = ( "//192.168.1.100/0/3/32768" @@ -174,7 +174,7 @@ def test_build_resolved_full_information_compare_with_id(self): uentity: UEntity = UEntityFactory.from_proto(service_descriptor) authority: UAuthority = UAuthority( - name="1G1YZ23J9P5800001.veh.com", id=b"1G1YZ23J9P5800001" + name="1G1YZ23J9P5800001.veh.steven.gm.com", id=b"1G1YZ23J9P5800001" ) uuri: UUri = UUri(entity=uentity, resource=uresrc, authority=authority) @@ -185,7 +185,7 @@ def test_build_resolved_full_information_compare_with_id(self): actual_micro_uri: bytes = MicroUriSerializer().serialize(uuri) expected_longuri_given_id_uathority: str = ( - "//1G1YZ23J9P5800001.veh.com/core.usubscription/3/SubscriptionChange#Update" + "//1G1YZ23J9P5800001.veh.steven.gm.com/core.usubscription/3/SubscriptionChange#Update" ) expected_shorturi_given_id_uathority: str = ( "//1G1YZ23J9P5800001/0/3/32768" @@ -220,7 +220,7 @@ def test_build_resolved_full_information_compare_with_ipv6(self): ipv6_packed_ip: bytes = socket.inet_pton(socket.AF_INET6, ipv6_address) authority: UAuthority = UAuthority( - name="vcu.veh.com", ip=ipv6_packed_ip + name="vcu.veh.steven.gm.com", ip=ipv6_packed_ip ) uuri: UUri = UUri(entity=uentity, resource=uresrc, authority=authority) @@ -231,7 +231,7 @@ def test_build_resolved_full_information_compare_with_ipv6(self): actual_micro_uri: bytes = MicroUriSerializer().serialize(uuri) expected_longuri_given_ipv6_uathority: str = ( - "//vcu.veh.com/core.usubscription/3/SubscriptionChange#Update" + "//vcu.veh.steven.gm.com/core.usubscription/3/SubscriptionChange#Update" ) expected_shorturi_given_ipv6_uathority: str = ( "//2001:db8:85a3::8a2e:370:7334/0/3/32768" diff --git a/tests/test_uri/test_validator/test_urivalidator.py b/tests/test_uri/test_validator/test_urivalidator.py index a887576..6b44703 100644 --- a/tests/test_uri/test_validator/test_urivalidator.py +++ b/tests/test_uri/test_validator/test_urivalidator.py @@ -523,13 +523,13 @@ def test_is_remote_when_authority_is_null(self): # self.assertEqual(authority.number_case(), UAuthority.NumberCase.ID) # def test_is_remote_when_authority_has_name_and_number_set(self): - # authority = UAuthority(name="vcu.veh.com", id=b"hello Jello") + # authority = UAuthority(name="vcu.veh.steven.gm.com", id=b"hello Jello") # self.assertTrue(UriValidator.is_remote(authority)) # self.assertTrue(authority.name is not None) # self.assertEqual(authority.number_case(), UAuthority.NumberCase.ID) # def test_is_remote_when_authority_has_name_and_number_is_not_set(self): - # authority = UAuthority(name="vcu.veh.com") + # authority = UAuthority(name="vcu.veh.steven.gm.com") # self.assertTrue(UriValidator.is_remote(authority)) # self.assertTrue(authority.name is not None) # self.assertEqual(authority.number_case(), UAuthority.NumberCase.NUMBER_NOT_SET) diff --git a/tests/test_uuid/test_factory/test_uuidutils.py b/tests/test_uuid/test_factory/test_uuidutils.py index 12a3ee9..f5b556a 100644 --- a/tests/test_uuid/test_factory/test_uuidutils.py +++ b/tests/test_uuid/test_factory/test_uuidutils.py @@ -43,8 +43,8 @@ def create_id(): def build_source(): return UUri( - authority=UAuthority(name="vcu.someVin.veh.com"), - entity=UEntity(name="petapp.com", version_major=1), + authority=UAuthority(name="vcu.someVin.veh.steven.gm.com"), + entity=UEntity(name="petapp.steven.gm.com", version_major=1), resource=UResource(name="door", instance="front_left", message="Door"), ) From 55a394d7a23dc45edf32c5123f3accd70302ee18 Mon Sep 17 00:00:00 2001 From: Matthew D'Alonzo Date: Tue, 7 May 2024 13:26:54 -0400 Subject: [PATCH 3/3] Remove "steven" where not necessary --- tests/test_uri/test_serializer/test_uriserializer.py | 12 ++++++------ tests/test_uri/test_validator/test_urivalidator.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_uri/test_serializer/test_uriserializer.py b/tests/test_uri/test_serializer/test_uriserializer.py index 088cfa9..8c6c2ef 100644 --- a/tests/test_uri/test_serializer/test_uriserializer.py +++ b/tests/test_uri/test_serializer/test_uriserializer.py @@ -130,7 +130,7 @@ def test_build_resolved_full_information_compare_with_ipv4(self): ipv4_packed_ip: bytes = socket.inet_pton(socket.AF_INET, ipv4_address) authority: UAuthority = UAuthority( - name="vcu.veh.steven.gm.com", ip=ipv4_packed_ip + name="vcu.veh.gm.com", ip=ipv4_packed_ip ) uuri: UUri = UUri(entity=uentity, resource=uresrc, authority=authority) @@ -141,7 +141,7 @@ def test_build_resolved_full_information_compare_with_ipv4(self): actual_micro_uri: bytes = MicroUriSerializer().serialize(uuri) expected_longuri_given_ipv4_uathority: str = ( - "//vcu.veh.steven.gm.com/core.usubscription/3/SubscriptionChange#Update" + "//vcu.veh.gm.com/core.usubscription/3/SubscriptionChange#Update" ) expected_shorturi_given_ipv4_uathority: str = ( "//192.168.1.100/0/3/32768" @@ -174,7 +174,7 @@ def test_build_resolved_full_information_compare_with_id(self): uentity: UEntity = UEntityFactory.from_proto(service_descriptor) authority: UAuthority = UAuthority( - name="1G1YZ23J9P5800001.veh.steven.gm.com", id=b"1G1YZ23J9P5800001" + name="1G1YZ23J9P5800001.veh.gm.com", id=b"1G1YZ23J9P5800001" ) uuri: UUri = UUri(entity=uentity, resource=uresrc, authority=authority) @@ -185,7 +185,7 @@ def test_build_resolved_full_information_compare_with_id(self): actual_micro_uri: bytes = MicroUriSerializer().serialize(uuri) expected_longuri_given_id_uathority: str = ( - "//1G1YZ23J9P5800001.veh.steven.gm.com/core.usubscription/3/SubscriptionChange#Update" + "//1G1YZ23J9P5800001.veh.gm.com/core.usubscription/3/SubscriptionChange#Update" ) expected_shorturi_given_id_uathority: str = ( "//1G1YZ23J9P5800001/0/3/32768" @@ -220,7 +220,7 @@ def test_build_resolved_full_information_compare_with_ipv6(self): ipv6_packed_ip: bytes = socket.inet_pton(socket.AF_INET6, ipv6_address) authority: UAuthority = UAuthority( - name="vcu.veh.steven.gm.com", ip=ipv6_packed_ip + name="vcu.veh.gm.com", ip=ipv6_packed_ip ) uuri: UUri = UUri(entity=uentity, resource=uresrc, authority=authority) @@ -231,7 +231,7 @@ def test_build_resolved_full_information_compare_with_ipv6(self): actual_micro_uri: bytes = MicroUriSerializer().serialize(uuri) expected_longuri_given_ipv6_uathority: str = ( - "//vcu.veh.steven.gm.com/core.usubscription/3/SubscriptionChange#Update" + "//vcu.veh.gm.com/core.usubscription/3/SubscriptionChange#Update" ) expected_shorturi_given_ipv6_uathority: str = ( "//2001:db8:85a3::8a2e:370:7334/0/3/32768" diff --git a/tests/test_uri/test_validator/test_urivalidator.py b/tests/test_uri/test_validator/test_urivalidator.py index 6b44703..f5131a5 100644 --- a/tests/test_uri/test_validator/test_urivalidator.py +++ b/tests/test_uri/test_validator/test_urivalidator.py @@ -523,13 +523,13 @@ def test_is_remote_when_authority_is_null(self): # self.assertEqual(authority.number_case(), UAuthority.NumberCase.ID) # def test_is_remote_when_authority_has_name_and_number_set(self): - # authority = UAuthority(name="vcu.veh.steven.gm.com", id=b"hello Jello") + # authority = UAuthority(name="vcu.veh.gm.com", id=b"hello Jello") # self.assertTrue(UriValidator.is_remote(authority)) # self.assertTrue(authority.name is not None) # self.assertEqual(authority.number_case(), UAuthority.NumberCase.ID) # def test_is_remote_when_authority_has_name_and_number_is_not_set(self): - # authority = UAuthority(name="vcu.veh.steven.gm.com") + # authority = UAuthority(name="vcu.veh.gm.com") # self.assertTrue(UriValidator.is_remote(authority)) # self.assertTrue(authority.name is not None) # self.assertEqual(authority.number_case(), UAuthority.NumberCase.NUMBER_NOT_SET)