From 94bb3506a49084558b550cc68ecdbbeb791f237e Mon Sep 17 00:00:00 2001 From: Boris Pavlovic Date: Fri, 4 Oct 2013 17:17:30 +0400 Subject: [PATCH] Fix orhestrator.api test Change-Id: Iea876acead01ca0163aa77176a219bba93727cee --- tests/test_orhestrator.py | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/tests/test_orhestrator.py b/tests/test_orhestrator.py index 65a97b800d..ef5b18d7d7 100644 --- a/tests/test_orhestrator.py +++ b/tests/test_orhestrator.py @@ -25,22 +25,14 @@ from rally import test class OrchestratorTestCase(test.NoDBTestCase): - def setUp(self): - super(OrchestratorTestCase, self).setUp() - self.de = mock.patch('rally.deploy.EngineFactory') - self.te = mock.patch('rally.benchmark.engine.TestEngine') - self.de.start() - self.te.start() - - def tearDonw(self): - self.de.stop() - self.te.stop() - super(OrchestratorTestCase, self).tearDonw() - def test_start_task(self): - # TODO(boris-42): Improve these tests, to check that requried mehtods - # are called. - api.start_task({'deploy': {'name': 'test'}, 'tests': {}}) + config = {'deploy': {'name': 'test'}, 'tests': {}} + + with mock.patch("rally.orchestrator.api.task"): + with mock.patch("rally.orchestrator.api.deploy"): + with mock.patch("rally.orchestrator.api.engine"): + # NOTE(boris-42) Improve this test case. + api.start_task(config) def test_abort_task(self): self.assertRaises(NotImplementedError, api.abort_task, 'uuid')