Esempio n. 1
0
 def test_healthy(self):
     '''
     Tests successful return of healthy function
     '''
     ret = {}
     ret['stdout'] = "all pools are healthy"
     ret['stderr'] = ""
     ret['retcode'] = 0
     mock_cmd = MagicMock(return_value=ret)
     with patch.dict(zpool.__salt__, {'cmd.run_all': mock_cmd}):
         self.assertTrue(zpool.healthy())
Esempio n. 2
0
 def test_healthy(self):
     '''
     Tests successful return of healthy function
     '''
     ret = {}
     ret['stdout'] = "all pools are healthy"
     ret['stderr'] = ""
     ret['retcode'] = 0
     mock_cmd = MagicMock(return_value=ret)
     with patch.dict(zpool.__salt__, {'cmd.run_all': mock_cmd}):
         self.assertTrue(zpool.healthy())
Esempio n. 3
0
    def test_healthy(self):
        """
        Tests successful return of healthy function
        """
        ret = {}
        ret["stdout"] = "all pools are healthy"
        ret["stderr"] = ""
        ret["retcode"] = 0
        mock_cmd = MagicMock(return_value=ret)

        with patch.dict(zpool.__salt__, {"cmd.run_all": mock_cmd}), patch.dict(
                zpool.__utils__, self.utils_patch):
            self.assertTrue(zpool.healthy())