Clean action runtime project state
This commit is contained in:
@@ -66,3 +66,17 @@ class TestContainerService:
|
||||
svc = ContainerService(ctx)
|
||||
svc.remove("api")
|
||||
assert any("docker" in str(c) and "rm" in str(c) for c in runner.calls)
|
||||
|
||||
def test_exec_command_uses_container_exec_action(self, tmp_path):
|
||||
runner = FakeRunner(responses={
|
||||
("ps", "{{.Names}}"): subprocess.CompletedProcess([], 0, stdout="dev-api\n"),
|
||||
})
|
||||
ctx = _make_ctx(tmp_path, runner=runner)
|
||||
svc = ContainerService(ctx)
|
||||
|
||||
try:
|
||||
svc.exec("api", ["echo", "hello"])
|
||||
except SystemExit as e:
|
||||
assert e.code == 0
|
||||
|
||||
assert ["docker", "exec", "dev-api", "echo", "hello"] in runner.calls
|
||||
|
||||
Reference in New Issue
Block a user