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