Beispiel #1
0
 def test_probe_w_device_kwarg_and_arg(self, *args, **kwargs):
     '''device arg is concatanated with possitional args'''
     parted.probe("/dev/sdb", device="/dev/sda")
     parted.salt.utils.kwargs_warn_until.called_once_with(
         {'device': '/dev/sda'})
     self.cmdrun.called_once_with(['partprobe', '/dev/sda', '/dev/sdb'],
                                  python_shell=False)
Beispiel #2
0
 def test_probe_w_device_kwarg(self, *args, **kwargs):
     run = MagicMock()
     with patch.dict(parted.__salt__, {'cmd.run': run}):
         parted.probe(device="/dev/sda")
     parted.salt.utils.kwargs_warn_until.called_once_with(
         {'device': '/dev/sda'})
     run.called_once_with(['partprobe', '/dev/sda'], python_shell=False)
Beispiel #3
0
 def test_probe_w_device_kwarg_and_arg(self, *args, **kwargs):
     '''device arg is concatanated with possitional args'''
     run = MagicMock()
     with patch.dict(parted.__salt__, {'cmd.run': run}):
         parted.probe("/dev/sdb", device="/dev/sda")
     parted.salt.utils.kwargs_warn_until.called_once_with(
         {'device': '/dev/sda'})
     run.called_once_with(['partprobe', '/dev/sda', '/dev/sdb'],
                          python_shell=False)
Beispiel #4
0
 def test_probe_w_device_kwarg(self, *args, **kwargs):
     device_kwargs = {'device': '/dev/sda'}
     parted.probe(**device_kwargs)
     self.check_kwargs_warn_until_devices(device_kwargs)
     self.cmdrun.assert_called_once_with('partprobe -- /dev/sda')
Beispiel #5
0
 def test_probe_wo_args(self):
     parted.probe()
     self.cmdrun.assert_called_once_with('partprobe -- ')
Beispiel #6
0
 def test_probe_w_single_arg(self):
     with patch('salt.modules.parted._validate_device', MagicMock()):
         parted.probe('/dev/sda')
         self.cmdrun.assert_called_once_with('partprobe -- /dev/sda')
Beispiel #7
0
 def test_probe_w_single_arg(self):
     parted.probe('/dev/sda')
     self.cmdrun.assert_called_once_with('partprobe -- /dev/sda')
Beispiel #8
0
 def test_probe_w_multiple_args(self):
     parted.probe('/dev/sda', '/dev/sdb')
     self.cmdrun.assert_called_once_with('partprobe -- /dev/sda /dev/sdb')
Beispiel #9
0
 def test_probe_w_single_arg(self):
     parted.probe("/dev/sda")
     self.cmdrun.called_once_with(['partprobe', '/dev/sda'],
                                  python_shell=False)
Beispiel #10
0
 def test_probe_w_device_kwarg_and_arg(self, *args, **kwargs):
     '''device arg is concatenated with positional args'''
     device_kwargs = {'device': '/dev/sda'}
     parted.probe("/dev/sdb", **device_kwargs)
     self.check_kwargs_warn_until_devices(device_kwargs)
     self.cmdrun.assert_called_once_with('partprobe -- /dev/sda /dev/sdb')
Beispiel #11
0
 def test_probe_w_device_kwarg_and_arg(self, *args, **kwargs):
     '''device arg is concatenated with positional args'''
     device_kwargs = {'device': '/dev/sda'}
     parted.probe("/dev/sdb", **device_kwargs)
     self.check_kwargs_warn_until_devices(device_kwargs)
     self.cmdrun.assert_called_once_with('partprobe -- /dev/sda /dev/sdb')
Beispiel #12
0
 def test_probe_w_single_arg(self):
     parted.probe("/dev/sda")
     self.cmdrun.assert_called_once_with('partprobe -- /dev/sda')
Beispiel #13
0
 def test_probe_w_multiple_args(self):
     run = MagicMock()
     with patch.dict(parted.__salt__, {'cmd.run': run}):
         parted.probe('/dev/sda', '/dev/sdb')
     run.called_once_with(['partprobe', '/dev/sda', '/dev/sdb'],
                          python_shell=False)
Beispiel #14
0
 def test_probe_wo_args(self):
     run = MagicMock()
     with patch.dict(parted.__salt__, {'cmd.run': run}):
         parted.probe()
     run.called_once_with(['partprobe'], python_shell=False)
Beispiel #15
0
 def test_probe_w_multiple_args(self):
     parted.probe("/dev/sda", "/dev/sdb")
     self.cmdrun.assert_called_once_with("partprobe -- /dev/sda /dev/sdb")
Beispiel #16
0
 def test_probe_w_multiple_args(self):
     parted.probe('/dev/sda', '/dev/sdb')
     self.cmdrun.called_once_with(['partprobe', '/dev/sda', '/dev/sdb'],
                                  python_shell=False)
Beispiel #17
0
 def test_probe_w_device_kwarg(self, *args, **kwargs):
     parted.probe(device="/dev/sda")
     parted.salt.utils.kwargs_warn_until.called_once_with(
         {'device': '/dev/sda'})
     self.cmdrun.called_once_with(['partprobe', '/dev/sda'],
                                  python_shell=False)
Beispiel #18
0
 def test_probe_wo_args(self):
     parted.probe()
     self.cmdrun.assert_called_once_with('partprobe -- ')
Beispiel #19
0
 def test_probe_w_device_kwarg(self, *args, **kwargs):
     device_kwargs = {'device': '/dev/sda'}
     parted.probe(**device_kwargs)
     self.check_kwargs_warn_until_devices(device_kwargs)
     self.cmdrun.assert_called_once_with('partprobe -- /dev/sda')
Beispiel #20
0
 def test_probe_w_multiple_args(self):
     parted.probe('/dev/sda', '/dev/sdb')
     self.cmdrun.assert_called_once_with('partprobe -- /dev/sda /dev/sdb')
Beispiel #21
0
 def test_probe_wo_args(self):
     parted.probe()
     self.cmdrun.called_once_with(['partprobe'], python_shell=False)