Skip to content

Commit

Permalink
Update tests with slot medium_id
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikek committed Aug 16, 2024
1 parent 0f1540a commit 60e92f9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ESSArch_Core/tests/test_tasks_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 60e92f9

Please sign in to comment.