def test_get_common_ancestor_folder__current_folder_open(self): parent_dir = '/c/users' temp = parent_dir + '/example.py' path = ctagsplugin.get_common_ancestor_folder(temp, [parent_dir]) # should return parent of the two child directories the deepest common # folder self.assertEqual(path, parent_dir)
def test_get_common_ancestor_folder__single_ancestor_folder_open(self): parent_dir = "/c/users" child_dir = parent_dir + "/child" temp = child_dir + "/example.py" path = ctagsplugin.get_common_ancestor_folder(temp, [parent_dir]) # should return parent of the two child directories the deepest common # folder self.assertEqual(path, parent_dir)
def test_get_common_ancestor_folder__single_child_folder_open(self): parent_dir = '/c/users' child_dir = parent_dir + '/child' grandchild_dir = child_dir + '/grandchild' temp = child_dir + '/example.py' # create temporary folders and files path = ctagsplugin.get_common_ancestor_folder(temp, [grandchild_dir]) # should return child directory as the deepest common folder self.assertEqual(path, child_dir)