Example #1
0
    def test_find_tags_relative_to__find_tags_in_current_directory(self):
        TAG_FILE = "example_tags"

        current_path = self.build_python_file()
        tag_file = ctags.build_ctags(path=current_path, tag_file=TAG_FILE)

        # should find tag file in current directory
        self.assertEqual(ctagsplugin.find_tags_relative_to(current_path, TAG_FILE), tag_file)

        # cleanup
        self.remove_tmp_files([current_path, tag_file])
Example #2
0
    def test_find_tags_relative_to__find_tags_in_current_directory(self):
        TAG_FILE = 'example_tags'

        current_path = self.build_python_file()
        tag_file = ctags.build_ctags(path=current_path, tag_file=TAG_FILE)

        # should find tag file in current directory
        self.assertEqual(
            ctagsplugin.find_tags_relative_to(current_path, TAG_FILE),
            tag_file)

        # cleanup
        self.remove_tmp_files([current_path, tag_file])
Example #3
0
    def test_find_tags_relative_to__find_tags_in_parent_directory(self):
        TAG_FILE = "example_tags"

        parent_path = self.build_python_file()
        parent_tag_file = ctags.build_ctags(path=parent_path, tag_file=TAG_FILE)
        child_dir = self.make_tmp_directory()
        child_path = self.build_python_file(pwd=child_dir)

        # should find tag file in parent directory
        self.assertEqual(ctagsplugin.find_tags_relative_to(child_path, TAG_FILE), parent_tag_file)

        # cleanup
        self.remove_tmp_files([parent_path, parent_tag_file])
        self.remove_tmp_directory(child_dir)
Example #4
0
    def test_find_tags_relative_to__find_tags_in_parent_directory(self):
        TAG_FILE = 'example_tags'

        parent_path = self.build_python_file()
        parent_tag_file = ctags.build_ctags(path=parent_path,
                                            tag_file=TAG_FILE)
        child_dir = self.make_tmp_directory()
        child_path = self.build_python_file(pwd=child_dir)

        # should find tag file in parent directory
        self.assertEqual(
            ctagsplugin.find_tags_relative_to(child_path, TAG_FILE),
            parent_tag_file)

        # cleanup
        self.remove_tmp_files([parent_path, parent_tag_file])
        self.remove_tmp_directory(child_dir)