def test__device_name_is_partition__device_is_not_a_partition(self, _populate_disks_entries_mock): dq = LinuxDiskDeviceQueries() self.assertTrue(dq._device_name_is_partition("sda1")) self.assertTrue(dq._device_name_is_partition("sdab12"))
def test__device_name_is_partition__device_is_not_valid(self, _populate_disks_entries_mock): dq = LinuxDiskDeviceQueries() self.assertFalse(dq._device_name_is_partition("/dev/sda1")) self.assertFalse(dq._device_name_is_partition("sda1a"))
def test__device_name_is_partition__device_is_a_partition(self, _populate_disks_entries_mock): dq = LinuxDiskDeviceQueries() self.assertEqual(1, _populate_disks_entries_mock.call_count) self.assertFalse(dq._device_name_is_partition("sda")) self.assertFalse(dq._device_name_is_partition("sdab"))