From c3008b69946a06eed044840246325ebee9bf0c97 Mon Sep 17 00:00:00 2001 From: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> Date: Mon, 9 Oct 2023 21:31:12 +0000 Subject: [PATCH] Update unit tests --- src/openjd/adaptor_runtime/_entrypoint.py | 1 + .../adaptor_runtime/unit/background/test_frontend_runner.py | 5 ++++- test/openjd/adaptor_runtime/unit/test_entrypoint.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/openjd/adaptor_runtime/_entrypoint.py b/src/openjd/adaptor_runtime/_entrypoint.py index 86a6aae..5275ccf 100644 --- a/src/openjd/adaptor_runtime/_entrypoint.py +++ b/src/openjd/adaptor_runtime/_entrypoint.py @@ -241,6 +241,7 @@ def _build_argparser(self) -> ArgumentParser: path_mapping_rules = ArgumentParser(add_help=False) path_mapping_rules.add_argument( "--path-mapping-rules", + default="", required=False, type=_load_data, help=_CLI_HELP_TEXT["path_mapping_rules"], diff --git a/test/openjd/adaptor_runtime/unit/background/test_frontend_runner.py b/test/openjd/adaptor_runtime/unit/background/test_frontend_runner.py index 114e586..f454899 100644 --- a/test/openjd/adaptor_runtime/unit/background/test_frontend_runner.py +++ b/test/openjd/adaptor_runtime/unit/background/test_frontend_runner.py @@ -80,10 +80,11 @@ def test_initializes_backend_process( adaptor_module.__package__ = "package" conn_file_path = "/path" init_data = {"init": "data"} + path_mapping_data = {} runner = FrontendRunner(conn_file_path) # WHEN - runner.init(adaptor_module, init_data) + runner.init(adaptor_module, init_data, path_mapping_data) # THEN assert caplog.messages == [ @@ -104,6 +105,8 @@ def test_initializes_backend_process( conn_file_path, "--init-data", json.dumps(init_data), + "--path-mapping-rules", + json.dumps(path_mapping_data), ], shell=False, close_fds=True, diff --git a/test/openjd/adaptor_runtime/unit/test_entrypoint.py b/test/openjd/adaptor_runtime/unit/test_entrypoint.py index 3747676..4b638b0 100644 --- a/test/openjd/adaptor_runtime/unit/test_entrypoint.py +++ b/test/openjd/adaptor_runtime/unit/test_entrypoint.py @@ -415,7 +415,7 @@ def test_runs_background_start( # THEN _parse_args_mock.assert_called_once() - mock_magic_init.assert_called_once_with(mock_adaptor_module, {}) + mock_magic_init.assert_called_once_with(mock_adaptor_module, {}, {}) mock_magic_start.assert_called_once_with(conn_file) mock_start.assert_called_once_with()