Skip to content

Commit 1edf987

Browse files
committed
Add tests for wait_for_logs.
1 parent aabe8c9 commit 1edf987

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_core.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import pytest
2+
3+
from testcontainers.core.container import DockerContainer
4+
from testcontainers.core.waiting_utils import wait_for_logs
5+
6+
7+
def test_raise_timeout():
8+
with pytest.raises(TimeoutError):
9+
with DockerContainer("alpine").with_command("sleep 2") as container:
10+
wait_for_logs(container, "Hello from Docker!", timeout=1e-3)
11+
12+
13+
def test_wait_for_hello():
14+
with DockerContainer("hello-world") as container:
15+
wait_for_logs(container, "Hello from Docker!")

0 commit comments

Comments
 (0)