def test_find_view1(self): """ Test finding a view for an existing task. """ editor = StandardEditor(workbench=self.workbench) editor.selected_task = None editor.selected_task = RootTask() assert_is_instance(editor._internal.current_view, RootView)
def test_find_view2(self): """ Test finding a view for a non-existing task. """ editor = StandardEditor(workbench=self.workbench) class Toto(RootTask): pass editor.selected_task = None editor.selected_task = Toto() assert_is_instance(editor._internal.current_view, FailureView)