mirror of
https://github.com/d9pouces/id_configurator.git
synced 2026-11-09 01:47:21 +01:00
feat: update Dockerfiles and configuration for TLS support across multiple modules
Signed-off-by: d9pouces <github@19pouces.net>
This commit is contained in:
+2
-10
@@ -1,5 +1,4 @@
|
||||
import json
|
||||
import subprocess
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from typer.testing import CliRunner
|
||||
@@ -66,14 +65,7 @@ def test_apply_skips_irrelevant_modules(tmp_path, caplog) -> None:
|
||||
assert "skipping module python" in caplog.text
|
||||
|
||||
|
||||
def test_apply_runs_relevant_module(tmp_path, monkeypatch) -> None:
|
||||
mock_run = MagicMock(
|
||||
return_value=subprocess.CompletedProcess(
|
||||
args=[], returncode=0, stdout="", stderr=""
|
||||
)
|
||||
)
|
||||
monkeypatch.setattr("id_configurator.modules.certificates.subprocess.run", mock_run)
|
||||
|
||||
def test_apply_runs_relevant_module(tmp_path) -> None:
|
||||
config_path = write_config(tmp_path, CONFIG_WITH_CERT)
|
||||
dst = tmp_path / "dst"
|
||||
result = runner.invoke(
|
||||
@@ -82,7 +74,7 @@ def test_apply_runs_relevant_module(tmp_path, monkeypatch) -> None:
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert (dst / "usr/local/share/ca-certificates/my-ca.crt").read_bytes() == b"fake"
|
||||
mock_run.assert_called_once()
|
||||
assert (dst / "etc/ssl/certs/ca-certificates.crt").read_bytes() == b"fake\n"
|
||||
|
||||
|
||||
def test_main_default_name_calls_app(monkeypatch) -> None:
|
||||
|
||||
Reference in New Issue
Block a user