FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
testcontainers-python/tests/test_docker_compose.py at master · mbode/testcontainers-python · GitHub
mbode
/
testcontainers-python
Public
forked from
testcontainers/testcontainers-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
testcontainers-python
/
tests
/
test_docker_compose.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (25 loc) · 920 Bytes
Breadcrumbs
testcontainers-python
/
tests
/
test_docker_compose.py
Copy path
File metadata and controls
36 lines (25 loc) · 920 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import
os
import
pytest
from
selenium
import
webdriver
from
testcontainers
.
compose
import
DockerCompose
from
testcontainers
.
core
.
exceptions
import
NoSuchPortExposed
def
test_can_spawn_service_via_compose
():
compose
=
DockerCompose
(
os
.
path
.
dirname
(
__file__
))
try
:
compose
.
start
()
host
=
compose
.
get_service_host
(
"hub"
,
4444
)
port
=
compose
.
get_service_port
(
"hub"
,
4444
)
assert
host
==
"0.0.0.0"
assert
port
==
"4444"
finally
:
compose
.
stop
()
def
test_can_throw_exception_if_no_port_exposed
():
compose
=
DockerCompose
(
os
.
path
.
dirname
(
__file__
))
compose
.
start
()
with
pytest
.
raises
(
NoSuchPortExposed
):
compose
.
get_service_host
(
"hub"
,
5555
)
compose
.
stop
()
def
test_compose_wait_for_container_ready
():
compose
=
DockerCompose
(
os
.
path
.
dirname
(
__file__
))
with
compose
:
compose
.
wait_for
(
"http://localhost:4444/wd/hub"
)
Back
|
FazBrowse Home
|
New Git URL