From 5373096c88f027ceef3c346cdd30f46ebdb39c55 Mon Sep 17 00:00:00 2001 From: Oleh Anufriiev Date: Fri, 13 Feb 2015 18:59:50 +0200 Subject: [PATCH] Remove task validation from api.Task.start The goals of this patch: * to separate log output of task validation and task start printout. * don't create task db record and set task's status during 'rally task validate' Change-Id: I6b22eeaebfd2854715b07bcca5c5dfcb8c756ad8 --- tests/unit/fakes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/unit/fakes.py b/tests/unit/fakes.py index fced5e99..45650e17 100644 --- a/tests/unit/fakes.py +++ b/tests/unit/fakes.py @@ -1587,5 +1587,15 @@ class FakeDeployment(dict): class FakeTask(dict): + def __init__(self, task=None, temporary=False, **kwargs): + self.is_temporary = temporary + self.task = task or kwargs + self.set_failed = mock.Mock() + + def __getitem__(self, key): + if key in self: + return self[key] + return self.task[key] + def to_dict(self): return self