File tree Expand file tree Collapse file tree 1 file changed +9
-28
lines changed
compose/testcontainers/compose Expand file tree Collapse file tree 1 file changed +9
-28
lines changed Original file line number Diff line number Diff line change @@ -23,39 +23,20 @@ class DockerCompose:
23
23
24
24
.. doctest::
25
25
26
- >>> compose_filename = ["docker-compose-1.yml", "docker-compose-2.yml"]
27
- >>> compose = DockerCompose("/home/project", compose_file_name=compose_file_name,
26
+ >>> from testcontainers.compose import DockerCompose
27
+
28
+ >>> compose = DockerCompose("compose/tests", compose_file_name="docker-compose-4.yml",
28
29
... pull=True)
29
- ... with compose:
30
- ... host = compose.get_service_host("hub", 4444)
31
- ... port = compose.get_service_port("hub", 4444)
32
- ... driver = webdriver.Remote(
33
- ... command_executor=(f"http://{host}:{port}/wd/hub"),
34
- ... desired_capabilities=CHROME,
35
- ... )
36
- ... driver.get("http://automation-remarks.com")
30
+ >>> with compose:
37
31
... stdout, stderr = compose.get_logs()
38
- ... if stderr:
39
- ... print(f"Errors \\ n:{stderr}")
32
+ >>> b"Hello from Docker!" in stdout
33
+ True
40
34
41
35
.. code-block:: yaml
42
36
43
- hub:
44
- image: selenium/hub
45
- ports:
46
- - "4444:4444"
47
- firefox:
48
- image: selenium/node-firefox
49
- links:
50
- - hub
51
- expose:
52
- - "5555"
53
- chrome:
54
- image: selenium/node-chrome
55
- links:
56
- - hub
57
- expose:
58
- - "5555"
37
+ services:
38
+ hello-world:
39
+ image: "hello-world"
59
40
"""
60
41
def __init__ (
61
42
self ,
You can’t perform that action at this time.
0 commit comments