Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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')
Exemplo n.º 5
0
 def test_probe_wo_args(self):
     parted.probe()
     self.cmdrun.assert_called_once_with('partprobe -- ')
Exemplo n.º 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')
Exemplo n.º 7
0
 def test_probe_w_single_arg(self):
     parted.probe('/dev/sda')
     self.cmdrun.assert_called_once_with('partprobe -- /dev/sda')
Exemplo n.º 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')
Exemplo n.º 9
0
 def test_probe_w_single_arg(self):
     parted.probe("/dev/sda")
     self.cmdrun.called_once_with(['partprobe', '/dev/sda'],
                                  python_shell=False)
Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 12
0
 def test_probe_w_single_arg(self):
     parted.probe("/dev/sda")
     self.cmdrun.assert_called_once_with('partprobe -- /dev/sda')
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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")
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 18
0
 def test_probe_wo_args(self):
     parted.probe()
     self.cmdrun.assert_called_once_with('partprobe -- ')
Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 21
0
 def test_probe_wo_args(self):
     parted.probe()
     self.cmdrun.called_once_with(['partprobe'], python_shell=False)