Simplify YouCompleteMe test
Add missing python-future boilerplate.
This commit is contained in:
parent
b78c403cfe
commit
fae95812dc
@ -27,41 +27,21 @@ from ycm.test_utils import MockVimModule
|
|||||||
MockVimModule()
|
MockVimModule()
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
from mock import MagicMock
|
||||||
from mock import patch
|
|
||||||
from hamcrest import assert_that, is_in, is_not
|
from hamcrest import assert_that, is_in, is_not
|
||||||
|
|
||||||
from ycm import base
|
|
||||||
from ycm.youcompleteme import YouCompleteMe
|
from ycm.youcompleteme import YouCompleteMe
|
||||||
from ycmd import user_options_store
|
|
||||||
|
|
||||||
|
|
||||||
class YouCompleteMe_test():
|
class YouCompleteMe_test():
|
||||||
|
|
||||||
# Minimal options to create the YouCompleteMe object.
|
|
||||||
DEFAULT_OPTIONS = {
|
|
||||||
'ycm_server_log_level': 'info',
|
|
||||||
'ycm_server_keep_logfiles': 0,
|
|
||||||
'ycm_min_num_of_chars_for_completion': 2,
|
|
||||||
'ycm_auto_trigger': 1,
|
|
||||||
'ycm_semantic_triggers': {}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def setUp( self ):
|
def setUp( self ):
|
||||||
with patch( 'vim.eval', side_effect = self.VimEval ):
|
self.ycm = YouCompleteMe( MagicMock( spec_set = dict ) )
|
||||||
user_options_store.SetAll( base.BuildServerConf() )
|
|
||||||
self.ycm = YouCompleteMe( user_options_store.GetAll() )
|
|
||||||
|
|
||||||
|
|
||||||
def tearDown( self ):
|
def tearDown( self ):
|
||||||
self.ycm.OnVimLeave()
|
self.ycm.OnVimLeave()
|
||||||
|
|
||||||
|
|
||||||
def VimEval( self, value ):
|
|
||||||
if value == 'g:':
|
|
||||||
return self.DEFAULT_OPTIONS
|
|
||||||
|
|
||||||
|
|
||||||
def YcmCoreNotImported_test( self ):
|
def YcmCoreNotImported_test( self ):
|
||||||
assert_that( 'ycm_core', is_not( is_in( sys.modules ) ) )
|
assert_that( 'ycm_core', is_not( is_in( sys.modules ) ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user