def test_start_server(self): """ should start server with specified settings """ kwargs = dict(port=9999, debug=True, host='TEST') with mock.patch('cauldron.cli.server.run.APPLICATION.run') as func: server_run.execute(**kwargs) func.assert_called_once_with(**kwargs)
def test_start_server_version(self): """ should return server version without starting the server """ with mock.patch('cauldron.cli.server.run.APPLICATION.run') as func: try: server_run.execute(version=True) except SystemExit: pass func.assert_not_called()
def run_server(port=5010, debug=False, **kwargs): """ Run the cauldron http server used to interact with cauldron from a remote host. :param port: The port on which to bind the cauldron server. :param debug: Whether or not the server should be run in debug mode. If true, the server will echo debugging information during operation. :param kwargs: Custom properties to alter the way the server runs. """ from cauldron.cli.server import run run.execute(port=port, debug=debug, **kwargs)
def run(): try: import cauldron except ImportError: sys.path.append(os.path.abspath(os.path.join(MY_DIRECTORY, '..', '..'))) try: import cauldron except ImportError: raise ImportError(' '.join( ('Unable to import cauldron.' 'The package was not installed in a known location.'))) from cauldron.cli.server import run run.execute(**run.parse())
def run_kernel(args: dict) -> int: """Runs the kernel sub command""" server_run.execute(**args) return 0