def test__extract_uuid_from_blkid_no_uuid(self, _populate_disks_entries_mock, run_cmd_mock): run_cmd_mock.return_value = "" fake_device_filepath = "/dev/sda1" dq = LinuxDiskDeviceQueries() self.assertEqual(None, dq._extract_uuid_from_blkid(fake_device_filepath))
def test__extract_uuid_from_blkid(self, _populate_disks_entries_mock, run_cmd_mock): run_cmd_mock.return_value = FAKE_BLKID_OUTPUT fake_device_filepath = "/dev/sda1" dq = LinuxDiskDeviceQueries() self.assertEqual("51270839-1a9b-44a2-9786-e078206342c2", dq._extract_uuid_from_blkid(fake_device_filepath))