Refactor DockerComposeManager usage in basic_example and enhance error handling for service, network, config, and secret management
This commit is contained in:
@ -71,12 +71,8 @@ def test_modify_nonexistent_service(tmp_path: Path) -> None:
|
||||
def test_remove_nonexistent_service(tmp_path: Path) -> None:
|
||||
compose_file: Path = tmp_path / "docker-compose.yml"
|
||||
manager = DockerComposeManager(str(compose_file))
|
||||
# Should not raise
|
||||
manager.remove_service("notfound").save()
|
||||
with compose_file.open() as f:
|
||||
data = yaml.safe_load(f)
|
||||
assert "services" in data
|
||||
assert data["services"] == {}
|
||||
with pytest.raises(KeyError):
|
||||
manager.remove_service("notfound")
|
||||
|
||||
|
||||
def test_create_service_with_extra_kwargs(tmp_path: Path) -> None:
|
||||
|
Reference in New Issue
Block a user