Refactoring tests to use new helper methods
Plus minor formatting fixes.
This commit is contained in:
parent
72d91957fc
commit
a4da9ee686
@ -63,6 +63,7 @@ class CsharpDiagnosticLocation:
|
|||||||
self.column_number_ = column
|
self.column_number_ = column
|
||||||
self.filename_ = filename
|
self.filename_ = filename
|
||||||
|
|
||||||
|
|
||||||
class CsharpCompleter( Completer ):
|
class CsharpCompleter( Completer ):
|
||||||
"""
|
"""
|
||||||
A Completer that uses the Omnisharp server as completion engine.
|
A Completer that uses the Omnisharp server as completion engine.
|
||||||
|
@ -20,7 +20,8 @@
|
|||||||
from ..server_utils import SetUpPythonPath
|
from ..server_utils import SetUpPythonPath
|
||||||
SetUpPythonPath()
|
SetUpPythonPath()
|
||||||
import time
|
import time
|
||||||
from .test_utils import Setup, BuildRequest, PathToTestFile
|
from .test_utils import ( Setup, BuildRequest, PathToTestFile,
|
||||||
|
StopOmniSharpServer )
|
||||||
from webtest import TestApp
|
from webtest import TestApp
|
||||||
from nose.tools import with_setup, eq_
|
from nose.tools import with_setup, eq_
|
||||||
from hamcrest import ( assert_that, contains, contains_string, has_entries,
|
from hamcrest import ( assert_that, contains, contains_string, has_entries,
|
||||||
@ -169,7 +170,8 @@ def Diagnostics_CsCompleter_ZeroBasedLineAndColumn_test():
|
|||||||
assert_that( results,
|
assert_that( results,
|
||||||
contains(
|
contains(
|
||||||
has_entries( {
|
has_entries( {
|
||||||
'text': contains_string( "Unexpected symbol `}'', expecting identifier" ),
|
'text': contains_string(
|
||||||
|
"Unexpected symbol `}'', expecting identifier" ),
|
||||||
'location': has_entries( {
|
'location': has_entries( {
|
||||||
'line_num': 9,
|
'line_num': 9,
|
||||||
'column_num': 1
|
'column_num': 1
|
||||||
@ -186,6 +188,8 @@ def Diagnostics_CsCompleter_ZeroBasedLineAndColumn_test():
|
|||||||
} )
|
} )
|
||||||
} ) ) )
|
} ) ) )
|
||||||
|
|
||||||
|
StopOmniSharpServer( app )
|
||||||
|
|
||||||
|
|
||||||
@with_setup( Setup )
|
@with_setup( Setup )
|
||||||
def GetDetailedDiagnostic_ClangCompleter_Works_test():
|
def GetDetailedDiagnostic_ClangCompleter_Works_test():
|
||||||
@ -248,14 +252,12 @@ def GetDetailedDiagnostic_CsCompleter_Works_test():
|
|||||||
|
|
||||||
results = app.post_json( '/detailed_diagnostic', diag_data ).json
|
results = app.post_json( '/detailed_diagnostic', diag_data ).json
|
||||||
assert_that( results,
|
assert_that( results,
|
||||||
has_entry( 'message', contains_string( "Unexpected symbol `}'', expecting identifier" ) ) )
|
has_entry(
|
||||||
|
'message',
|
||||||
|
contains_string(
|
||||||
|
"Unexpected symbol `}'', expecting identifier" ) ) )
|
||||||
|
|
||||||
|
StopOmniSharpServer( app )
|
||||||
# We need to turn off the CS server so that it doesn't stick around
|
|
||||||
app.post_json( '/run_completer_command',
|
|
||||||
BuildRequest( completer_target = 'filetype_default',
|
|
||||||
command_arguments = ['StopServer'],
|
|
||||||
filetype = 'cs' ) )
|
|
||||||
|
|
||||||
|
|
||||||
@with_setup( Setup )
|
@with_setup( Setup )
|
||||||
|
Loading…
Reference in New Issue
Block a user