def test_wipe(self): mock = MagicMock(return_value={'retcode': 0, 'stdout': ''}) with patch.dict(blockdev.__salt__, {'cmd.run_all': mock}): blockdev.wipe('/dev/sda') mock.assert_called_once_with( 'wipefs /dev/sda' )
def test_wipe(self): device = '/dev/sdX' mock = MagicMock(return_value={'retcode': 0, 'stdout': ''}) with patch.dict(blockdev.__salt__, {'cmd.run_all': mock}): blockdev.wipe(device) mock.assert_called_once_with('wipefs {0}'.format(device), python_shell=False)
def test_wipe(self): mock = MagicMock(return_value={"retcode": 0, "stdout": ""}) with patch.dict(blockdev.__salt__, {"cmd.run_all": mock}): blockdev.wipe("/dev/sda") mock.assert_called_once_with("wipefs /dev/sda", python_shell=False)
def test_wipe(self): with patch.dict(blockdev.__salt__, {'disk.wipe': MagicMock(return_value=True)}): self.assertTrue(blockdev.wipe('/dev/sda'))