QTZPOC-20
QTZPOC-20: Enhance OPC repository client configuration and secure connection validation; refine MLflow test error handling and async test execution; add SonarQube suppressions.
This commit is contained in:
@@ -20,8 +20,9 @@ def test_main_exits_when_runtime_is_unset(mock_get_logger, mock_app_up, monkeypa
|
||||
logger = MagicMock()
|
||||
mock_get_logger.return_value = logger
|
||||
|
||||
coro = main()
|
||||
with raises(SystemExit) as exc:
|
||||
asyncio.run(main())
|
||||
asyncio.run(coro)
|
||||
|
||||
assert exc.value.code == 1
|
||||
logger.custom_critical.assert_called_once()
|
||||
@@ -54,8 +55,9 @@ class TestMainHappyPath:
|
||||
mock_prepare_worker.return_value = worker
|
||||
mock_connect.return_value = MagicMock()
|
||||
|
||||
coro = main()
|
||||
with raises(SystemExit) as exc:
|
||||
asyncio.run(main())
|
||||
asyncio.run(coro)
|
||||
return exc.value.code
|
||||
|
||||
def test_runs_four_workers_without_the_import_flag( # noqa: PLR0913
|
||||
@@ -195,8 +197,9 @@ class TestMainHappyPath:
|
||||
worker.run = AsyncMock(side_effect=RuntimeError('boom'))
|
||||
mock_prepare_worker.return_value = worker
|
||||
|
||||
coro = main()
|
||||
with raises(SystemExit) as exc:
|
||||
asyncio.run(main())
|
||||
asyncio.run(coro)
|
||||
|
||||
assert exc.value.code == 1
|
||||
logger.custom_error.assert_called_once_with(ANY, ANY)
|
||||
|
||||
Reference in New Issue
Block a user