Skip to content

Commit

Permalink
Use PathToTestFile in identifier_completer_test
Browse files Browse the repository at this point in the history
  • Loading branch information
vheon committed Nov 3, 2016
1 parent 6b957a9 commit cb8a72c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 0 additions & 1 deletion ycmd/tests/get_completions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
standard_library.install_aliases()
from builtins import * # noqa

import os
from hamcrest import assert_that, equal_to, has_items, contains_string
from mock import patch
from nose.tools import eq_
Expand Down
13 changes: 3 additions & 10 deletions ycmd/tests/identifier_completer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,10 @@
from ycmd.completers.all import identifier_completer as ic
from ycmd.completers.all.identifier_completer import IdentifierCompleter
from ycmd.request_wrap import RequestWrap
from ycmd.tests import PathToTestFile
from ycmd.tests.test_utils import BuildRequest


TEST_DIR = os.path.dirname( os.path.abspath( __file__ ) )
DATA_DIR = os.path.join( TEST_DIR,
'..', '..',
'cpp', 'ycm',
'tests',
'testdata' )


def BuildRequestWrap( contents, column_num, line_num = 1 ):
return RequestWrap( BuildRequest( column_num = column_num,
line_num = line_num,
Expand Down Expand Up @@ -166,7 +159,7 @@ def FilterUnchangedTagFiles_SkipBadFiles_test():

def FilterUnchangedTagFiles_KeepGoodFiles_test():
ident_completer = IdentifierCompleter( DefaultOptions() )
tag_file = os.path.join( DATA_DIR, 'basic.tags' )
tag_file = PathToTestFile( 'basic.tags' )
eq_( [ tag_file ],
list( ident_completer._FilterUnchangedTagFiles( [ tag_file ] ) ) )

Expand All @@ -175,7 +168,7 @@ def FilterUnchangedTagFiles_SkipUnchangesFiles_test():
ident_completer = IdentifierCompleter( DefaultOptions() )

# simulate an already open tags file that didn't change in the meantime.
tag_file = os.path.join( DATA_DIR, 'basic.tags' )
tag_file = PathToTestFile( 'basic.tags' )
ident_completer._tags_file_last_mtime[ tag_file ] = os.path.getmtime(
tag_file )

Expand Down

0 comments on commit cb8a72c

Please sign in to comment.