From bf817b89bf8e61175f28d008e967df6d4c262f89 Mon Sep 17 00:00:00 2001 From: Michael Voigt Date: Wed, 27 Nov 2024 15:02:17 +0100 Subject: [PATCH] try to fix the tests --- simulators/extras/ExportProfileData.py | 4 ++-- test/export_import_test.py | 2 ++ test/simulators_test.py | 4 +--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/simulators/extras/ExportProfileData.py b/simulators/extras/ExportProfileData.py index e237350d..e747ac50 100644 --- a/simulators/extras/ExportProfileData.py +++ b/simulators/extras/ExportProfileData.py @@ -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 diff --git a/test/export_import_test.py b/test/export_import_test.py index 03fb3ebf..bf9f4d67 100644 --- a/test/export_import_test.py +++ b/test/export_import_test.py @@ -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 diff --git a/test/simulators_test.py b/test/simulators_test.py index 2bcd45e7..280c1337 100644 --- a/test/simulators_test.py +++ b/test/simulators_test.py @@ -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}")