Skip to content

Commit

Permalink
try to fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Voigt committed Nov 27, 2024
1 parent 5764795 commit bf817b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions simulators/extras/ExportProfileData.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ def CheckDeviceExternalIdById(deviceId, baseUrl):


def IsExternalIdTypeEventBasedSimulatorProfile(deviceExternalIdType):
if deviceExternalIdType == C8Y_PROFILE_GROUP:
if deviceExternalIdType == C8Y_OEE_SIMULATOR_DEVICES_GROUP:
return True
else:
consoleLogger.info(f"The type {deviceExternalIdType} of external ID must match with type {C8Y_PROFILE_GROUP}")
consoleLogger.info(f"The type {deviceExternalIdType} of the external ID is _not_ the same as type {C8Y_OEE_SIMULATOR_DEVICES_GROUP}!")
return False


Expand Down
2 changes: 2 additions & 0 deletions test/export_import_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def test_export_import_profile_data(self, mock_error):
finally:
# Change back to the original working directory
os.chdir(current_dir)
# Delete test device and profile
Utils.delete_device(self=self, device_id=device_id)

class Utilities:
@staticmethod
Expand Down
4 changes: 1 addition & 3 deletions test/simulators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,7 @@ def get_device_id_from_external_id(self, external_id):
device_id = self.cumulocity_api.get_device_by_external_id(external_id=f"{external_id}")
return device_id

def delete_oee_profile_and_device(self, profile_id, device_id):
self.cumulocity_api.delete_managed_object(profile_id)
log.info(f"Removed the test oee profile with id {profile_id}")
def delete_device(self, device_id):
self.cumulocity_api.delete_managed_object(device_id)
log.info(f"Removed the test device with id {device_id}")

Expand Down

0 comments on commit bf817b8

Please sign in to comment.