From 60e92f9a081c51809939cc20030b792336fb5745 Mon Sep 17 00:00:00 2001 From: henrikek Date: Sat, 17 Aug 2024 00:57:24 +0200 Subject: [PATCH] Update tests with slot medium_id --- ESSArch_Core/tests/test_tasks_util.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ESSArch_Core/tests/test_tasks_util.py b/ESSArch_Core/tests/test_tasks_util.py index dfea124ea..6e182f45c 100644 --- a/ESSArch_Core/tests/test_tasks_util.py +++ b/ESSArch_Core/tests/test_tasks_util.py @@ -32,7 +32,7 @@ def create_tape_drive(self): def create_storage_medium(self, tape_drive=None): robot = Robot.objects.create(device='slot_robot_device') - tape_slot = TapeSlot.objects.create(slot_id=12, robot=robot) + tape_slot = TapeSlot.objects.create(slot_id=12, robot=robot, medium_id="dummy_medium_id") storage_target = StorageTarget.objects.create() return StorageMedium.objects.create( tape_slot=tape_slot, @@ -60,7 +60,7 @@ def test_unmount_success(self, mock_unmount_tape): storage_medium.refresh_from_db() tape_drive.refresh_from_db() - mock_unmount_tape.assert_called_once_with("robot_device", 12, 2) + mock_unmount_tape.assert_called_once_with("robot_device", 12, 2, "dummy_medium_id") self.assertFalse(tape_drive.locked) self.assertIsNone(storage_medium.tape_drive) self.assertTrue(before <= tape_drive.last_change <= after) @@ -82,7 +82,7 @@ def test_unmount_when_unmount_tape_raise_exception(self, mock_unmount_tape, mock storage_medium.tape_slot.refresh_from_db() tape_drive.refresh_from_db() - mock_unmount_tape.assert_called_once_with("robot_device", 12, 2) + mock_unmount_tape.assert_called_once_with("robot_device", 12, 2, "dummy_medium_id") self.assertFalse(tape_drive.locked) self.assertEqual(storage_medium.status, 100) self.assertFalse(tape_drive.locked) @@ -130,7 +130,7 @@ def test_mount_when_mount_tape_raise_exception(self, mock_mount_tape): storage_medium.tape_slot.refresh_from_db() tape_drive.refresh_from_db() - mock_mount_tape.assert_called_once_with("robot_device", 12, 2) + mock_mount_tape.assert_called_once_with("robot_device", 12, 2, "dummy_medium_id") self.assertFalse(tape_drive.locked) self.assertEqual(storage_medium.status, 100) self.assertFalse(tape_drive.locked) @@ -153,7 +153,7 @@ def test_mount_when_wait_to_come_online_raise_exception(self, mock_mount_tape, m storage_medium.tape_slot.refresh_from_db() tape_drive.refresh_from_db() - mock_mount_tape.assert_called_once_with("robot_device", 12, 2) + mock_mount_tape.assert_called_once_with("robot_device", 12, 2, "dummy_medium_id") self.assertFalse(tape_drive.locked) self.assertEqual(storage_medium.status, 100) self.assertFalse(tape_drive.locked) @@ -176,7 +176,7 @@ def test_mount_success(self, mount_tape, wait_to_come_online, write_medium_label storage_medium.tape_slot.refresh_from_db() tape_drive.refresh_from_db() - mount_tape.assert_called_once_with("robot_device", 12, 2) + mount_tape.assert_called_once_with("robot_device", 12, 2, "dummy_medium_id") wait_to_come_online.assert_called_once_with("unique_char", 121) self.assertEqual(tape_drive.num_of_mounts, 1) self.assertTrue(tape_drive.locked)