Esempio n. 1
0
def test_id():
    """
    Test for Display unique id
    """
    mock = MagicMock(return_value="Monit ID: d3b1aba48527dd599db0e86f5ad97120")
    with patch.dict(monit.__salt__, {"cmd.run": mock}):
        assert monit.id_() == "d3b1aba48527dd599db0e86f5ad97120"
Esempio n. 2
0
 def test_id(self):
     '''
     Test for Display unique id
     '''
     mock = MagicMock(
         return_value='Monit ID: d3b1aba48527dd599db0e86f5ad97120')
     with patch.dict(monit.__salt__, {'cmd.run': mock}):
         self.assertEqual(monit.id_(), 'd3b1aba48527dd599db0e86f5ad97120')
Esempio n. 3
0
 def test_id(self):
     '''
     Test for Display unique id
     '''
     mock = MagicMock(
         return_value='Monit ID: d3b1aba48527dd599db0e86f5ad97120')
     with patch.dict(monit.__salt__, {'cmd.run': mock}):
         self.assertEqual(monit.id_(), 'd3b1aba48527dd599db0e86f5ad97120')
Esempio n. 4
0
def test_reset_id():
    """
    Test for Regenerate a unique id
    """
    expected = {"stdout": "Monit id d3b1aba48527dd599db0e86f5ad97120 and ..."}
    mock = MagicMock(return_value=expected)
    with patch.dict(monit.__salt__, {"cmd.run_all": mock}):
        assert monit.id_(reset=True) == "d3b1aba48527dd599db0e86f5ad97120"
Esempio n. 5
0
 def test_reset_id(self):
     '''
     Test for Regenerate a unique id
     '''
     expected = {
         'stdout': 'Monit id d3b1aba48527dd599db0e86f5ad97120 and ...'
     }
     mock = MagicMock(return_value=expected)
     with patch.dict(monit.__salt__, {'cmd.run_all': mock}):
         self.assertEqual(monit.id_(reset=True),
                          'd3b1aba48527dd599db0e86f5ad97120')
Esempio n. 6
0
 def test_reset_id(self):
     '''
     Test for Regenerate a unique id
     '''
     expected = {
         'stdout': 'Monit id d3b1aba48527dd599db0e86f5ad97120 and ...'
     }
     mock = MagicMock(return_value=expected)
     with patch.dict(monit.__salt__, {'cmd.run_all': mock}):
         self.assertEqual(monit.id_(reset=True),
                          'd3b1aba48527dd599db0e86f5ad97120')