예제 #1
0
    def test_get_rel_path_to_source__source_file_in_sibling_directory(self):
        temp = "/c/users/temporary_file"
        tag_file = "/c/users/tags"

        result = ctagsplugin.get_rel_path_to_source(temp, tag_file, multiple=False)

        relative_path = "temporary_file"

        self.assertEqual([relative_path], result)
예제 #2
0
    def test_get_rel_path_to_source__source_file_in_sibling_directory(self):
        temp = '/c/users/temporary_file'
        tag_file = '/c/users/tags'

        result = ctagsplugin.get_rel_path_to_source(
            temp, tag_file, multiple=False)

        relative_path = 'temporary_file'

        self.assertEqual([relative_path], result)
예제 #3
0
    def test_get_rel_path_to_source__source_file_in_child_directory(self):
        temp = "/c/users/folder/temporary_file"
        tag_file = "/c/users/tags"

        result = ctagsplugin.get_rel_path_to_source(temp, tag_file, multiple=False)

        # handle [windows, unix] paths
        relative_paths = ["folder\\temporary_file", "folder/temporary_file"]

        # self.assertEquals([relative_path], result)
        self.assertIn(result[0], relative_paths)
예제 #4
0
    def test_get_rel_path_to_source__source_file_in_child_directory(self):
        temp = '/c/users/folder/temporary_file'
        tag_file = '/c/users/tags'

        result = ctagsplugin.get_rel_path_to_source(
            temp, tag_file, multiple=False)

        # handle [windows, unix] paths
        relative_paths = ['folder\\temporary_file', 'folder/temporary_file']

        self.assertIn(result[0], relative_paths)