From 33167133fe4030239b2e230a1c6970cd0e16ef7f Mon Sep 17 00:00:00 2001 From: "thomas.storek" <20579672+tstorek@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:15:30 +0100 Subject: [PATCH] chore: fix broken-tests and put correct types For #225 --- tests/clients/test_ngsi_v2_iota.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/clients/test_ngsi_v2_iota.py b/tests/clients/test_ngsi_v2_iota.py index deb173ad..612e36a9 100644 --- a/tests/clients/test_ngsi_v2_iota.py +++ b/tests/clients/test_ngsi_v2_iota.py @@ -311,9 +311,9 @@ def test_patch_device(self): device.add_attribute(DeviceAttribute( name="Att1", object_id="o1", type=DataType.STRUCTUREDVALUE)) device.add_attribute(StaticDeviceAttribute( - name="Stat1", value="test", type=DataType.STRUCTUREDVALUE)) + name="Stat1", value="test", type=DataType.TEXT)) device.add_attribute(StaticDeviceAttribute( - name="Stat2", value="test", type=DataType.STRUCTUREDVALUE)) + name="Stat2", value="test", type=DataType.TEXT)) device.add_command(DeviceCommand(name="Com1")) # use patch_device to post @@ -338,7 +338,7 @@ def test_patch_device(self): device.add_attribute(DeviceAttribute( name="Att2", object_id="o1", type=DataType.STRUCTUREDVALUE)) device.add_attribute(StaticDeviceAttribute( - name="Stat3", value="test3", type=DataType.STRUCTUREDVALUE)) + name="Stat3", value="test3", type=DataType.TEXT)) device.add_command(DeviceCommand(name="Com2")) self.client.patch_device(device=device, cb_url=settings.CB_URL) @@ -379,14 +379,16 @@ def test_patch_device(self): def test_service_group(self): """ Test of querying service group based on apikey and resource. - """ # Create dummy service groups - group_base = ServiceGroup(service=settings.FIWARE_SERVICE, subservice=settings.FIWARE_SERVICEPATH, + group_base = ServiceGroup(service=settings.FIWARE_SERVICE, + subservice=settings.FIWARE_SERVICEPATH, resource="/iot/json", apikey="base") - group1 = ServiceGroup(service=settings.FIWARE_SERVICE, subservice=settings.FIWARE_SERVICEPATH, + group1 = ServiceGroup(service=settings.FIWARE_SERVICE, + subservice=settings.FIWARE_SERVICEPATH, resource="/iot/json", apikey="test1") - group2 = ServiceGroup(service=settings.FIWARE_SERVICE, subservice=settings.FIWARE_SERVICEPATH, + group2 = ServiceGroup(service=settings.FIWARE_SERVICE, + subservice=settings.FIWARE_SERVICEPATH, resource="/iot/json", apikey="test2") self.client.post_groups([group_base, group1, group2], update=True)