Esempio n. 1
0
 def test_run(self):
     '''
     Test if it runs one or more named munin plugins
     '''
     mock = MagicMock(return_value='uptime.value 0.01')
     with patch.dict(munin.__salt__, {'cmd.run': mock}):
         self.assertDictEqual(munin.run('uptime'),
                              {'uptime': {'uptime': 0.01}})
Esempio n. 2
0
 def test_run(self):
     '''
     Test if it runs one or more named munin plugins
     '''
     mock = MagicMock(return_value='uptime.value 0.01')
     with patch.dict(munin.__salt__, {'cmd.run': mock}):
         self.assertDictEqual(munin.run('uptime'),
                              {'uptime': {'uptime': 0.01}})
Esempio n. 3
0
def test_run():
    """
    Test if it runs one or more named munin plugins
    """
    mock = MagicMock(return_value="uptime.value 0.01")
    with patch.dict(munin.__salt__, {"cmd.run": mock}), patch(
        "salt.modules.munin.list_plugins", MagicMock(return_value=["uptime"])
    ):
        assert munin.run("uptime") == {"uptime": {"uptime": 0.01}}