def test_stdio(patch): """ Tests whether starting a stdio server works. """ patch.init(Workspace) patch.init(LanguageServer) patch.object(ConstServiceHub, 'from_json', return_value='ConstServiceHub') patch.object(LanguageServer, 'start') app = App(hub_path='.hub.') app.start_stdio_server() LanguageServer.__init__.assert_called_with(sys.stdin.buffer, sys.stdout.buffer, hub='ConstServiceHub') LanguageServer.start.assert_called()
def test_stdio(patch): """ Tests whether starting a stdio server works. """ patch.init(Workspace) patch.init(LanguageServer) patch.object(ServiceWrapper, "from_json_file", return_value="ConstServiceHub") patch.object(LanguageServer, "start") app = App(hub_path=".hub.") app.start_stdio_server() LanguageServer.__init__.assert_called_with(hub="ConstServiceHub") LanguageServer.start.assert_called_with(sys.stdin.buffer, sys.stdout.buffer)