class TestProbe(unittest.TestCase): def setUp(self): self._probe = Probe() def test_stop_method(self): self._probe.stop() self.assertEqual(self._probe.run(), 'stop method') def test_install_method(self): self._probe.install() self.assertEqual(self._probe.run(), 'install method') def test_read_method(self): self._probe.read() self.assertEqual(self._probe.run(), 'read method') def test_uninstall_method(self): self._probe.uninstall() self.assertEqual(self._probe.run(), 'uninstall method')
def run_test_resource(resource): """tests a service and provides run metrics""" result = ResourceResult(resource) result.start() probes = resource.probe_vars for probe in probes: result.add_result(Probe.run(resource, probe)) result.stop() return result
def run_test_resource(resource): """tests a service and provides run metrics""" result = ResourceResult(resource) if not resource.active: result.message = 'Skipped' return result result.start() probes = resource.probe_vars for probe in probes: result.add_result(Probe.run(resource, probe)) result.stop() return result