Beispiel #1
0
 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'
         )
Beispiel #2
0
 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)
Beispiel #3
0
 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):
     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)
Beispiel #5
0
 def test_wipe(self):
     with patch.dict(blockdev.__salt__, {'disk.wipe': MagicMock(return_value=True)}):
         self.assertTrue(blockdev.wipe('/dev/sda'))
Beispiel #6
0
 def test_wipe(self):
     with patch.dict(blockdev.__salt__, {'disk.wipe': MagicMock(return_value=True)}):
         self.assertTrue(blockdev.wipe('/dev/sda'))