diff --git a/core/tests/app_test.py b/core/tests/app_test.py index 50eb4700..a96802ce 100644 --- a/core/tests/app_test.py +++ b/core/tests/app_test.py @@ -168,10 +168,10 @@ class TestCaseDupeGuruWithResults: self.app = DupeGuru() self.objects,self.matches,self.groups = GetTestGroups() self.app.results.groups = self.groups - self.dpanel_gui = CallLogger() - self.dpanel = DetailsPanel(self.dpanel_gui, self.app) - self.dtree_gui = CallLogger() - self.dtree = DirectoryTree(self.dtree_gui, self.app) + self.dpanel = self.app.details_panel + self.dpanel.view = CallLogger() + self.dtree = self.app.directory_tree + self.dtree.view = CallLogger() self.rtable_gui = CallLogger() self.rtable = self.app.result_table self.rtable.view = self.rtable_gui @@ -299,10 +299,10 @@ class TestCaseDupeGuruWithResults: def test_refreshDetailsWithSelected(self, do_setup): self.rtable.select([1, 4]) eq_(self.dpanel.row(0), ('Filename', 'bar bleh', 'foo bar')) - self.dpanel_gui.check_gui_calls(['refresh']) + self.dpanel.view.check_gui_calls(['refresh']) self.rtable.select([]) eq_(self.dpanel.row(0), ('Filename', '---', '---')) - self.dpanel_gui.check_gui_calls(['refresh']) + self.dpanel.view.check_gui_calls(['refresh']) def test_makeSelectedReference(self, do_setup): app = self.app @@ -478,11 +478,11 @@ class TestAppWithDirectoriesInTree: io.mkdir(p + 'sub2') io.mkdir(p + 'sub3') self.app = DupeGuru() - self.dtree_gui = CallLogger() - self.dtree = DirectoryTree(self.dtree_gui, self.app) + self.dtree = self.app.directory_tree + self.dtree.view = CallLogger() self.dtree.connect() self.dtree.add_directory(p) - self.dtree_gui.clear_calls() + self.dtree.view.clear_calls() def test_set_root_as_ref_makes_subfolders_ref_as_well(self, do_setup): # Setting a node state to something also affect subnodes. These subnodes must be correctly @@ -495,5 +495,5 @@ class TestAppWithDirectoriesInTree: eq_(len(node), 3) subnode = node[0] eq_(subnode.state, 1) - self.dtree_gui.check_gui_calls(['refresh_states']) + self.dtree.view.check_gui_calls(['refresh_states']) diff --git a/core/tests/base.py b/core/tests/base.py index 5582fb76..a1c1f03c 100644 --- a/core/tests/base.py +++ b/core/tests/base.py @@ -52,7 +52,6 @@ class DupeGuru(DupeGuruBase): def __init__(self): DupeGuruBase.__init__(self, DupeGuruView(), '/tmp') - self.result_table = ResultTable(self) def _get_display_info(self, dupe, group, delta): size = dupe.size @@ -78,6 +77,10 @@ class DupeGuru(DupeGuruBase): def _prioritization_categories(self): return prioritize.all_categories() + + def _create_result_table(self): + return ResultTable(self) + class NamedObject: def __init__(self, name="foobar", with_words=False, size=1, folder=None): @@ -136,11 +139,9 @@ class TestApp(TestAppBase): self.app = DupeGuru() self.default_parent = self.app self.rtable = link_gui(self.app.result_table) - make_gui('dtree', DirectoryTree) - make_gui('dpanel', DetailsPanel) - make_gui('pdialog', PrioritizeDialog) - for elem in [self.rtable, self.dtree, self.dpanel]: - elem.connect() + self.dtree = link_gui(self.app.directory_tree) + self.dpanel = link_gui(self.app.details_panel) + self.pdialog = PrioritizeDialog(self.app) #--- Helpers def select_pri_criterion(self, name):