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