Skip to content

Commit

Permalink
Change CS completer tests for Omnisharp server without solution
Browse files Browse the repository at this point in the history
- Change the test to ensure that the OmniSharp server starts with an
empty solution file.
- Remove the test that was testing that the case where OmniSharp server
should not start when an unambiguous solution file is not found.
  • Loading branch information
sankhesh committed Nov 1, 2022
1 parent 3a708f9 commit f4bd725
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
13 changes: 7 additions & 6 deletions ycmd/tests/cs/debug_info_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,21 @@ def test_DebugInfo_ServerIsRunning( self, app ):


@SharedYcmd
def test_DebugInfo_ServerIsNotRunning_NoSolution( self, app ):
def test_DebugInfo_ServerIsRunning_NoSolution( self, app ):
request_data = BuildRequest( filetype = 'cs' )
assert_that(
app.post_json( '/debug_info', request_data ).json,
has_entry( 'completer', has_entries( {
'name': 'C#',
'servers': contains_exactly( has_entries( {
'name': 'OmniSharp',
'is_running': False,
'is_running': True,
'executable': instance_of( str ),
'pid': None,
'address': None,
'port': None,
'logfiles': empty()
'pid': instance_of( int ),
'address': instance_of( str ),
'port': instance_of( int ),
'logfiles': contains_exactly( instance_of( str ),
instance_of( str ) )
} ) ),
'items': empty()
} ) )
Expand Down
21 changes: 0 additions & 21 deletions ycmd/tests/cs/get_completions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,3 @@ def test_GetCompletions_PathWithSpace( self, app ):
),
'errors': empty(),
} ) )


@SharedYcmd
def test_GetCompletions_DoesntStartWithAmbiguousMultipleSolutions(
self, app ):
filepath = PathToTestFile( 'testy-multiple-solutions',
'solution-not-named-like-folder',
'testy', 'Program.cs' )
contents = ReadFile( filepath )
event_data = BuildRequest( filepath = filepath,
filetype = 'cs',
contents = contents,
event_name = 'FileReadyToParse' )

assert_that(
calling( app.post_json ).with_args( '/event_notification', event_data ),
raises( AppError, 'Autodetection of solution file failed' ),
"The Omnisharp server started, despite us not being able to find a "
"suitable solution file to feed it. Did you fiddle with the solution "
"finding code in cs_completer.py? Hopefully you've enhanced it: you need "
"to update this test then :)" )

0 comments on commit f4bd725

Please sign in to comment.