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)
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)
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)
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)