def test_find_missing_task(self): task = Hellbox.find_task_by_name("bazzio") Hellbox._warn = Hellbox.warn Hellbox.warn = Mock() task.run() assert Hellbox.warn.called Hellbox.warn = Hellbox._warn
def test_find_missing_task(self): task = Hellbox.find_task_by_name('bazzio') assert type(task) is NullTask Hellbox._warn = Hellbox.warn Hellbox.warn = Mock() task.run() assert Hellbox.warn.called Hellbox.warn = Hellbox._warn
def test_with(self): with Hellbox("foo") as task: assert task assert type(task) is Task assert Hellbox.find_task_by_name("foo")
def test_find_task_by_name(self): Hellbox.add_task(Task("foo")) assert Hellbox.find_task_by_name("foo")