mirror of
https://github.com/d9pouces/id_configurator.git
synced 2026-11-09 01:47:21 +01:00
refactor: remove unused NPM_TO_COPY variable from build.py
Signed-off-by: d9pouces <github@19pouces.net>
This commit is contained in:
+21
-1
@@ -33,7 +33,27 @@ def test_validate_valid_config(tmp_path) -> None:
|
||||
def test_validate_without_config_fails() -> None:
|
||||
result = runner.invoke(cli.app, ["validate"])
|
||||
assert result.exit_code != 0
|
||||
assert "either --config or --config-env" in result.output
|
||||
assert "either --config, --config-env" in result.output
|
||||
|
||||
|
||||
def _mock_urlopen(content: bytes) -> MagicMock:
|
||||
response = MagicMock()
|
||||
response.read.return_value = content
|
||||
response.__enter__.return_value = response
|
||||
response.__exit__.return_value = False
|
||||
return MagicMock(return_value=response)
|
||||
|
||||
|
||||
def test_validate_from_config_url(monkeypatch) -> None:
|
||||
monkeypatch.setattr(
|
||||
"id_configurator.config.urllib.request.urlopen",
|
||||
_mock_urlopen(json.dumps(MINIMAL_CONFIG).encode("utf-8")),
|
||||
)
|
||||
result = runner.invoke(
|
||||
cli.app, ["validate", "--config-url", "https://example.invalid/config.json"]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "is valid" in result.stdout
|
||||
|
||||
|
||||
def test_list_modules() -> None:
|
||||
|
||||
Reference in New Issue
Block a user