def test_reread_partitions_device_busy(self, mock_exec, mock_sleep):
     mock_exec.return_value = ("", "")
     pu.reread_partitions("/dev/fake", out="_Device or resource busy_")
     mock_exec_expected = [
         mock.call("partprobe", "/dev/fake", check_exit_code=[0, 1]),
         mock.call("udevadm", "settle", "--quiet", check_exit_code=[0]),
     ]
     self.assertEqual(mock_exec.call_args_list, mock_exec_expected)
     mock_sleep.assert_called_once_with(2)
 def test_reread_partitions_device_busy(self, mock_exec, mock_sleep):
     mock_exec.return_value = ('', '')
     pu.reread_partitions('/dev/fake', out='_Device or resource busy_')
     mock_exec_expected = [
         mock.call('partprobe', '/dev/fake', check_exit_code=[0, 1]),
         mock.call('udevadm', 'settle', '--quiet', check_exit_code=[0]),
     ]
     self.assertEqual(mock_exec.call_args_list, mock_exec_expected)
     mock_sleep.assert_called_once_with(2)
 def test_reread_partitions_device_busy(self, mock_exec, mock_sleep,
                                        mock_udev):
     mock_exec.return_value = ('', '')
     pu.reread_partitions('/dev/fake', out='_Device or resource busy_')
     mock_exec_expected = [
         mock.call('partprobe', '/dev/fake', check_exit_code=[0, 1]),
     ]
     self.assertEqual(mock_exec.call_args_list, mock_exec_expected)
     mock_sleep.assert_called_once_with(2)
     mock_udev.assert_called_once_with()
 def test_reread_partitions_ok(self, mock_exec):
     pu.reread_partitions('/dev/fake', out='')
     self.assertEqual(mock_exec.call_args_list, [])
 def test_reread_partitions_ok(self, mock_exec):
     pu.reread_partitions("/dev/fake", out="")
     self.assertEqual(mock_exec.call_args_list, [])