MCPcopy Create free account
hub / github.com/dagger/dagger / test_container_with

Function test_container_with

sdk/python/tests/client/test_integration.py:166–183  ·  view source on GitHub ↗
(alpine_image: str)

Source from the content-addressed store, hash-verified

164
165
166async def test_container_with(alpine_image: str):
167 def env(ctr: dagger.Container):
168 return ctr.with_env_variable("FOO", "bar")
169
170 def secret(token: str):
171 def _secret(ctr: dagger.Container):
172 return ctr.with_secret_variable("TOKEN", dag.set_secret("TOKEN", token))
173
174 return _secret
175
176 await (
177 dag.container()
178 .from_(alpine_image)
179 .with_(env)
180 .with_(secret("baz"))
181 .with_exec(["sh", "-c", "test $FOO = bar && test $TOKEN = baz"])
182 .sync()
183 )
184
185
186async def test_container_sync(alpine_image: str):

Callers

nothing calls this directly

Calls 6

from_Method · 0.80
secretFunction · 0.70
syncMethod · 0.65
with_execMethod · 0.45
with_Method · 0.45
containerMethod · 0.45

Tested by

no test coverage detected