Commit 2192dc4f by Kálmán Viktor

dashboard: prettify test mock

parent a892ffb6
...@@ -615,13 +615,12 @@ class NodeDetailTest(LoginMixin, MockCeleryMixin, TestCase): ...@@ -615,13 +615,12 @@ class NodeDetailTest(LoginMixin, MockCeleryMixin, TestCase):
node = Node.objects.get(pk=1) node = Node.objects.get(pk=1)
trait, created = Trait.objects.get_or_create(name='testtrait') trait, created = Trait.objects.get_or_create(name='testtrait')
node.traits.add(trait) node.traits.add(trait)
self.patcher = patch("vm.tasks.vm_tasks.get_queues") self.patcher = patch("vm.tasks.vm_tasks.get_queues", return_value={
self.mock_check_queue = self.patcher.start()
self.mock_check_queue.return_value = {
'x': [{'name': "devenv.vm.fast"}], 'x': [{'name': "devenv.vm.fast"}],
'y': [{'name': "devenv.vm.slow"}], 'y': [{'name': "devenv.vm.slow"}],
'z': [{'name': "devenv.net.fast"}], 'z': [{'name': "devenv.net.fast"}],
} })
self.patcher.start()
def tearDown(self): def tearDown(self):
super(NodeDetailTest, self).tearDown() super(NodeDetailTest, self).tearDown()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment