Skip to content

Commit

Permalink
chore: fix broken-tests and put correct types
Browse files Browse the repository at this point in the history
For #225
  • Loading branch information
tstorek committed Mar 7, 2024
1 parent 989894d commit 3316713
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/clients/test_ngsi_v2_iota.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 3316713

Please sign in to comment.