Пример #1
0
 def test_running(self):
     runresult = RunResult()
     runresult.return_code = 0
     runresult.stdout = "foo start/running, process 1234\n"
     node = MagicMock()
     node.run.return_value = runresult
     self.assertTrue(svc_upstart.svc_running(node, "foo"))
Пример #2
0
 def test_not_running(self):
     runresult = RunResult()
     runresult.stdout = "foo stop/waiting\n"
     node = MagicMock()
     node.run.return_value = runresult
     self.assertFalse(svc_upstart.svc_running(node, "foo"))