Skip to content

Commit 44ea04c

Browse files
author
Andrei Neagu
committed
bumped test coverage
1 parent b6fd7d8 commit 44ea04c

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

services/dynamic-scheduler/tests/unit/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_echo_dotenv(cli_runner: CliRunner, monkeypatch: pytest.MonkeyPatch):
3838

3939
with monkeypatch.context() as patch:
4040
setenvs_from_dict(patch, environs)
41-
ApplicationSettings.create_from_envs()
41+
assert ApplicationSettings.create_from_envs()
4242

4343

4444
def test_list_settings(

services/notifications/tests/unit/test_cli.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55

66
import pytest
77
from click.testing import Result
8-
from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict
8+
from pytest_simcore.helpers.monkeypatch_envs import (
9+
EnvVarsDict,
10+
load_dotenv,
11+
setenvs_from_dict,
12+
)
913
from simcore_service_notifications.cli import main
14+
from simcore_service_notifications.core.settings import ApplicationSettings
1015
from typer.testing import CliRunner
1116

1217
pytest_simcore_core_services_selection = [
@@ -38,3 +43,15 @@ async def test_process_cli_options(cli_runner: CliRunner):
3843
result = cli_runner.invoke(main, ["--version"])
3944
print(result.stdout)
4045
assert result.exit_code == 0, _format_cli_error(result)
46+
47+
48+
async def test_echo_dotenv(cli_runner: CliRunner, monkeypatch: pytest.MonkeyPatch):
49+
result = cli_runner.invoke(main, ["echo-dotenv"])
50+
print(result.stdout)
51+
assert result.exit_code == 0, _format_cli_error(result)
52+
53+
environs = load_dotenv(result.stdout)
54+
55+
with monkeypatch.context() as patch:
56+
setenvs_from_dict(patch, environs)
57+
assert ApplicationSettings.create_from_envs()

0 commit comments

Comments
 (0)