postcomplete_test.py 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. # encoding: utf-8
  2. #
  3. # Copyright (C) 2015-2016 YouCompleteMe contributors
  4. #
  5. # This file is part of YouCompleteMe.
  6. #
  7. # YouCompleteMe is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # YouCompleteMe is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
  19. from __future__ import unicode_literals
  20. from __future__ import print_function
  21. from __future__ import division
  22. from __future__ import absolute_import
  23. # Not installing aliases from python-future; it's unreliable and slow.
  24. from builtins import * # noqa
  25. from ycm.tests.test_utils import MockVimModule
  26. MockVimModule()
  27. import contextlib
  28. from hamcrest import assert_that, empty
  29. from mock import MagicMock, DEFAULT, patch
  30. from nose.tools import eq_, ok_
  31. from ycm import vimsupport
  32. from ycm.tests import YouCompleteMeInstance
  33. from ycmd.utils import ToBytes
  34. def GetVariableValue_CompleteItemIs( word, abbr = None, menu = None,
  35. info = None, kind = None ):
  36. def Result( variable ):
  37. if variable == 'v:completed_item':
  38. return {
  39. 'word': ToBytes( word ),
  40. 'abbr': ToBytes( abbr ),
  41. 'menu': ToBytes( menu ),
  42. 'info': ToBytes( info ),
  43. 'kind': ToBytes( kind ),
  44. }
  45. return DEFAULT
  46. return MagicMock( side_effect = Result )
  47. def BuildCompletion( namespace = None, insertion_text = 'Test',
  48. menu_text = None, extra_menu_info = None,
  49. detailed_info = None, kind = None ):
  50. return {
  51. 'extra_data': { 'required_namespace_import': namespace },
  52. 'insertion_text': insertion_text,
  53. 'menu_text': menu_text,
  54. 'extra_menu_info': extra_menu_info,
  55. 'kind': kind,
  56. 'detailed_info': detailed_info,
  57. }
  58. @contextlib.contextmanager
  59. def _SetupForCsharpCompletionDone( ycm, completions ):
  60. with patch( 'ycm.vimsupport.InsertNamespace' ):
  61. with patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Test' ):
  62. request = MagicMock()
  63. request.Done = MagicMock( return_value = True )
  64. request.RawResponse = MagicMock( return_value = completions )
  65. ycm._latest_completion_request = request
  66. yield
  67. @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'cs' ] )
  68. @YouCompleteMeInstance()
  69. def GetCompleteDoneHooks_ResultOnCsharp_test( ycm, *args ):
  70. result = ycm.GetCompleteDoneHooks()
  71. eq_( 1, len( list( result ) ) )
  72. @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'txt' ] )
  73. @YouCompleteMeInstance()
  74. def GetCompleteDoneHooks_EmptyOnOtherFiletype_test( ycm, *args ):
  75. result = ycm.GetCompleteDoneHooks()
  76. eq_( 0, len( list( result ) ) )
  77. @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'txt' ] )
  78. @YouCompleteMeInstance()
  79. def OnCompleteDone_WithActionCallsIt_test( ycm, *args ):
  80. action = MagicMock()
  81. ycm._complete_done_hooks[ 'txt' ] = action
  82. ycm.OnCompleteDone()
  83. ok_( action.called )
  84. @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'txt' ] )
  85. @YouCompleteMeInstance()
  86. def OnCompleteDone_NoActionNoError_test( ycm, *args ):
  87. ycm.OnCompleteDone()
  88. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  89. @patch( 'ycm.vimsupport.GetVariableValue',
  90. GetVariableValue_CompleteItemIs( 'Test' ) )
  91. @YouCompleteMeInstance()
  92. def FilterToCompletedCompletions_NewVim_MatchIsReturned_test( ycm, *args ):
  93. completions = [ BuildCompletion( insertion_text = 'Test' ) ]
  94. result = ycm._FilterToMatchingCompletions( completions, False )
  95. eq_( list( result ), completions )
  96. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  97. @patch( 'ycm.vimsupport.GetVariableValue',
  98. GetVariableValue_CompleteItemIs( 'A' ) )
  99. @YouCompleteMeInstance()
  100. def FilterToCompletedCompletions_NewVim_ShortTextDoesntRaise_test( ycm, *args ):
  101. completions = [ BuildCompletion( insertion_text = 'AAA' ) ]
  102. ycm._FilterToMatchingCompletions( completions, False )
  103. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  104. @patch( 'ycm.vimsupport.GetVariableValue',
  105. GetVariableValue_CompleteItemIs( 'Test' ) )
  106. @YouCompleteMeInstance()
  107. def FilterToCompletedCompletions_NewVim_ExactMatchIsReturned_test( ycm, *args ):
  108. completions = [ BuildCompletion( insertion_text = 'Test' ) ]
  109. result = ycm._FilterToMatchingCompletions( completions, False )
  110. eq_( list( result ), completions )
  111. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  112. @patch( 'ycm.vimsupport.GetVariableValue',
  113. GetVariableValue_CompleteItemIs( ' Quote' ) )
  114. @YouCompleteMeInstance()
  115. def FilterToCompletedCompletions_NewVim_NonMatchIsntReturned_test( ycm, *args ):
  116. completions = [ BuildCompletion( insertion_text = 'A' ) ]
  117. result = ycm._FilterToMatchingCompletions( completions, False )
  118. assert_that( list( result ), empty() )
  119. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  120. @patch( 'ycm.vimsupport.GetVariableValue',
  121. GetVariableValue_CompleteItemIs( '†es†' ) )
  122. @YouCompleteMeInstance()
  123. def FilterToCompletedCompletions_NewVim_Unicode_test( ycm, *args ):
  124. completions = [ BuildCompletion( insertion_text = '†es†' ) ]
  125. result = ycm._FilterToMatchingCompletions( completions, False )
  126. eq_( list( result ), completions )
  127. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  128. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Test' )
  129. @YouCompleteMeInstance()
  130. def FilterToCompletedCompletions_OldVim_MatchIsReturned_test( ycm, *args ):
  131. completions = [ BuildCompletion( insertion_text = 'Test' ) ]
  132. result = ycm._FilterToMatchingCompletions( completions, False )
  133. eq_( list( result ), completions )
  134. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  135. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'X' )
  136. @YouCompleteMeInstance()
  137. def FilterToCompletedCompletions_OldVim_ShortTextDoesntRaise_test( ycm,
  138. *args ):
  139. completions = [ BuildCompletion( insertion_text = 'AAA' ) ]
  140. ycm._FilterToMatchingCompletions( completions, False )
  141. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  142. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'Test' )
  143. @YouCompleteMeInstance()
  144. def FilterToCompletedCompletions_OldVim_ExactMatchIsReturned_test( ycm,
  145. *args ):
  146. completions = [ BuildCompletion( insertion_text = 'Test' ) ]
  147. result = ycm._FilterToMatchingCompletions( completions, False )
  148. eq_( list( result ), completions )
  149. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  150. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
  151. @YouCompleteMeInstance()
  152. def FilterToCompletedCompletions_OldVim_NonMatchIsntReturned_test( ycm,
  153. *args ):
  154. completions = [ BuildCompletion( insertion_text = 'A' ) ]
  155. result = ycm._FilterToMatchingCompletions( completions, False )
  156. assert_that( list( result ), empty() )
  157. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  158. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'Uniçø∂¢' )
  159. @YouCompleteMeInstance()
  160. def FilterToCompletedCompletions_OldVim_Unicode_test( ycm, *args ):
  161. completions = [ BuildCompletion( insertion_text = 'Uniçø∂¢' ) ]
  162. result = ycm._FilterToMatchingCompletions( completions, False )
  163. assert_that( list( result ), empty() )
  164. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  165. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Te' )
  166. @YouCompleteMeInstance()
  167. def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_MatchIsReturned_test( # noqa
  168. ycm, *args ):
  169. completions = [ BuildCompletion( insertion_text = 'Test' ) ]
  170. result = ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
  171. eq_( result, True )
  172. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  173. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'X' )
  174. @YouCompleteMeInstance()
  175. def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ShortTextDoesntRaise_test( # noqa
  176. ycm, *args ):
  177. completions = [ BuildCompletion( insertion_text = "AAA" ) ]
  178. ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
  179. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  180. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'Test' )
  181. @YouCompleteMeInstance()
  182. def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ExactMatchIsntReturned_test( # noqa
  183. ycm, *args ):
  184. completions = [ BuildCompletion( insertion_text = 'Test' ) ]
  185. result = ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
  186. eq_( result, False )
  187. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  188. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
  189. @YouCompleteMeInstance()
  190. def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_NonMatchIsntReturned_test( # noqa
  191. ycm, *args ):
  192. completions = [ BuildCompletion( insertion_text = 'A' ) ]
  193. result = ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
  194. eq_( result, False )
  195. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  196. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'Uniç' )
  197. @YouCompleteMeInstance()
  198. def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_Unicode_test(
  199. ycm, *args ):
  200. completions = [ BuildCompletion( insertion_text = 'Uniçø∂¢' ) ]
  201. result = ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
  202. eq_( result, True )
  203. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  204. @patch( 'ycm.vimsupport.GetVariableValue',
  205. GetVariableValue_CompleteItemIs( 'Te' ) )
  206. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
  207. @YouCompleteMeInstance()
  208. def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_MatchIsReturned_test( # noqa
  209. ycm, *args ):
  210. completions = [ BuildCompletion( insertion_text = 'Test' ) ]
  211. result = ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
  212. eq_( result, True )
  213. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  214. @patch( 'ycm.vimsupport.GetVariableValue',
  215. GetVariableValue_CompleteItemIs( 'X' ) )
  216. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
  217. @YouCompleteMeInstance()
  218. def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ShortTextDoesntRaise_test( # noqa
  219. ycm, *args ):
  220. completions = [ BuildCompletion( insertion_text = 'AAA' ) ]
  221. ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
  222. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  223. @patch( 'ycm.vimsupport.GetVariableValue',
  224. GetVariableValue_CompleteItemIs( 'Test' ) )
  225. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
  226. @YouCompleteMeInstance()
  227. def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ExactMatchIsntReturned_test( # noqa
  228. ycm, *args ):
  229. completions = [ BuildCompletion( insertion_text = 'Test' ) ]
  230. result = ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
  231. eq_( result, False )
  232. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  233. @patch( 'ycm.vimsupport.GetVariableValue',
  234. GetVariableValue_CompleteItemIs( ' Quote' ) )
  235. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
  236. @YouCompleteMeInstance()
  237. def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_NonMatchIsntReturned_test( # noqa
  238. ycm, *args ):
  239. completions = [ BuildCompletion( insertion_text = "A" ) ]
  240. result = ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
  241. eq_( result, False )
  242. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  243. @patch( 'ycm.vimsupport.GetVariableValue',
  244. GetVariableValue_CompleteItemIs( 'Uniç' ) )
  245. @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'Uniç' )
  246. @YouCompleteMeInstance()
  247. def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_Unicode_test(
  248. ycm, *args ):
  249. completions = [ BuildCompletion( insertion_text = 'Uniçø∂¢' ) ]
  250. result = ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
  251. eq_( result, True )
  252. @YouCompleteMeInstance()
  253. def GetRequiredNamespaceImport_ReturnNoneForNoExtraData_test( ycm ):
  254. eq_( None, ycm._GetRequiredNamespaceImport( {} ) )
  255. @YouCompleteMeInstance()
  256. def GetRequiredNamespaceImport_ReturnNamespaceFromExtraData_test( ycm ):
  257. namespace = 'A_NAMESPACE'
  258. eq_( namespace, ycm._GetRequiredNamespaceImport(
  259. BuildCompletion( namespace )
  260. ) )
  261. @YouCompleteMeInstance()
  262. def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfNotDone_test( ycm ):
  263. with _SetupForCsharpCompletionDone( ycm, [] ):
  264. ycm._latest_completion_request.Done = MagicMock( return_value = False )
  265. eq_( [], ycm.GetCompletionsUserMayHaveCompleted() )
  266. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  267. @patch( 'ycm.vimsupport.GetVariableValue',
  268. GetVariableValue_CompleteItemIs( 'Te' ) )
  269. @YouCompleteMeInstance()
  270. def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_NewVim_test( # noqa
  271. ycm, *args ):
  272. completions = [ BuildCompletion( None ) ]
  273. with _SetupForCsharpCompletionDone( ycm, completions ):
  274. eq_( [], ycm.GetCompletionsUserMayHaveCompleted() )
  275. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  276. @YouCompleteMeInstance()
  277. def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_OldVim_test( # noqa
  278. ycm, *args ):
  279. completions = [ BuildCompletion( None ) ]
  280. with _SetupForCsharpCompletionDone( ycm, completions ):
  281. with patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Te' ):
  282. eq_( [], ycm.GetCompletionsUserMayHaveCompleted() )
  283. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  284. @YouCompleteMeInstance()
  285. def GetCompletionsUserMayHaveCompleted_ReturnMatchIfExactMatches_NewVim_test(
  286. ycm, *args ):
  287. info = [ 'NS', 'Test', 'Abbr', 'Menu', 'Info', 'Kind' ]
  288. completions = [ BuildCompletion( *info ) ]
  289. with _SetupForCsharpCompletionDone( ycm, completions ):
  290. with patch( 'ycm.vimsupport.GetVariableValue',
  291. GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):
  292. eq_( completions, ycm.GetCompletionsUserMayHaveCompleted() )
  293. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  294. @YouCompleteMeInstance()
  295. def GetCompletionsUserMayHaveCompleted_ReturnMatchIfExactMatchesEvenIfPartial_NewVim_test( # noqa
  296. ycm, *args ):
  297. info = [ 'NS', 'Test', 'Abbr', 'Menu', 'Info', 'Kind' ]
  298. completions = [ BuildCompletion( *info ),
  299. BuildCompletion( insertion_text = 'TestTest' ) ]
  300. with _SetupForCsharpCompletionDone( ycm, completions ):
  301. with patch( 'ycm.vimsupport.GetVariableValue',
  302. GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):
  303. eq_( [ completions[ 0 ] ], ycm.GetCompletionsUserMayHaveCompleted() )
  304. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  305. @YouCompleteMeInstance()
  306. def GetCompletionsUserMayHaveCompleted_DontReturnMatchIfNontExactMatchesAndPartial_NewVim_test( # noqa
  307. ycm, *args ):
  308. info = [ 'NS', 'Test', 'Abbr', 'Menu', 'Info', 'Kind' ]
  309. completions = [ BuildCompletion( insertion_text = info[ 0 ] ),
  310. BuildCompletion( insertion_text = 'TestTest' ) ]
  311. with _SetupForCsharpCompletionDone( ycm, completions ):
  312. with patch( 'ycm.vimsupport.GetVariableValue',
  313. GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):
  314. eq_( [], ycm.GetCompletionsUserMayHaveCompleted() )
  315. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
  316. @patch( 'ycm.vimsupport.GetVariableValue',
  317. GetVariableValue_CompleteItemIs( 'Test' ) )
  318. @YouCompleteMeInstance()
  319. def GetCompletionsUserMayHaveCompleted_ReturnMatchIfMatches_NewVim_test(
  320. ycm, *args ):
  321. completions = [ BuildCompletion( None ) ]
  322. with _SetupForCsharpCompletionDone( ycm, completions ):
  323. eq_( completions, ycm.GetCompletionsUserMayHaveCompleted() )
  324. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  325. @YouCompleteMeInstance()
  326. def GetCompletionsUserMayHaveCompleted_ReturnMatchIfMatches_OldVim_test(
  327. ycm, *args ):
  328. completions = [ BuildCompletion( None ) ]
  329. with _SetupForCsharpCompletionDone( ycm, completions ):
  330. eq_( completions, ycm.GetCompletionsUserMayHaveCompleted() )
  331. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  332. @YouCompleteMeInstance()
  333. def PostCompleteCsharp_EmptyDoesntInsertNamespace_test( ycm, *args ):
  334. with _SetupForCsharpCompletionDone( ycm, [] ):
  335. ycm._OnCompleteDone_Csharp()
  336. ok_( not vimsupport.InsertNamespace.called )
  337. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  338. @YouCompleteMeInstance()
  339. def PostCompleteCsharp_ExistingWithoutNamespaceDoesntInsertNamespace_test(
  340. ycm, *args ):
  341. completions = [ BuildCompletion( None ) ]
  342. with _SetupForCsharpCompletionDone( ycm, completions ):
  343. ycm._OnCompleteDone_Csharp()
  344. ok_( not vimsupport.InsertNamespace.called )
  345. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  346. @YouCompleteMeInstance()
  347. def PostCompleteCsharp_ValueDoesInsertNamespace_test( ycm, *args ):
  348. namespace = 'A_NAMESPACE'
  349. completions = [ BuildCompletion( namespace ) ]
  350. with _SetupForCsharpCompletionDone( ycm, completions ):
  351. ycm._OnCompleteDone_Csharp()
  352. vimsupport.InsertNamespace.assert_called_once_with( namespace )
  353. @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
  354. @patch( 'ycm.vimsupport.PresentDialog', return_value = 1 )
  355. @YouCompleteMeInstance()
  356. def PostCompleteCsharp_InsertSecondNamespaceIfSelected_test( ycm, *args ):
  357. namespace = 'A_NAMESPACE'
  358. namespace2 = 'ANOTHER_NAMESPACE'
  359. completions = [
  360. BuildCompletion( namespace ),
  361. BuildCompletion( namespace2 ),
  362. ]
  363. with _SetupForCsharpCompletionDone( ycm, completions ):
  364. ycm._OnCompleteDone_Csharp()
  365. vimsupport.InsertNamespace.assert_called_once_with( namespace2 )