mirror of
https://github.com/d9pouces/id_configurator.git
synced 2026-11-09 01:47:21 +01:00
feat: new configurations for APK/Java/Python/Yum
Signed-off-by: d9pouces <github@19pouces.net>
This commit is contained in:
+3
-4
@@ -1,4 +1,3 @@
|
||||
import base64
|
||||
import subprocess
|
||||
from configparser import ConfigParser
|
||||
from unittest.mock import MagicMock
|
||||
@@ -9,7 +8,7 @@ from id_configurator.config import Configuration
|
||||
from id_configurator.context import Context
|
||||
from id_configurator.modules.yum import YumModule
|
||||
|
||||
KEY_CONTENT = base64.b64encode(b"fake-rpm-gpg-key-bytes").decode("ascii")
|
||||
KEY_CONTENT = "fake-rpm-gpg-key-bytes"
|
||||
|
||||
CONFIG_WITH_REPO_AND_KEY = {
|
||||
"uuid": "12345678-1234-5678-1234-567812345678",
|
||||
@@ -169,13 +168,13 @@ def test_apply_disables_existing_repos_before_adding_configured_ones(tmp_path) -
|
||||
def test_import_key_raises_when_gpg_binary_missing(tmp_path, monkeypatch) -> None:
|
||||
monkeypatch.setattr(
|
||||
"id_configurator.modules.yum.subprocess.run",
|
||||
MagicMock(side_effect=FileNotFoundError()),
|
||||
MagicMock(side_effect=FileNotFoundError("invalid GPG key")),
|
||||
)
|
||||
context = Context(
|
||||
config=make_config(CONFIG_WITH_REPO_AND_KEY), dst=tmp_path / "dst", src=None
|
||||
)
|
||||
|
||||
with pytest.raises(RuntimeError, match="gpg is not available"):
|
||||
with pytest.raises(FileNotFoundError, match="invalid GPG key"):
|
||||
YumModule().apply(context)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user