|
8 | 8 | import pytest |
9 | 9 | from pytest_mock import MockerFixture |
10 | 10 |
|
11 | | -from testcontainers.compose import DockerCompose |
| 11 | +from testcontainers.compose import DockerCompose, ComposeContainer |
12 | 12 | from testcontainers.core.exceptions import ContainerIsNotRunning, NoSuchPortExposed |
13 | 13 |
|
14 | 14 | FIXTURES = Path(__file__).parent.joinpath("compose_fixtures") |
@@ -430,32 +430,7 @@ def test_container_info_network_details(): |
430 | 430 |
|
431 | 431 | def test_container_info_none_when_no_docker_compose(): |
432 | 432 | """Test get_container_info returns None when docker_compose reference is missing""" |
433 | | - from testcontainers.compose.compose import ComposeContainer |
434 | 433 |
|
435 | 434 | container = ComposeContainer() |
436 | 435 | info = container.get_container_info() |
437 | 436 | assert info is None |
438 | | - |
439 | | - |
440 | | -def test_docker_container_info(): |
441 | | - """Test get_container_info works with DockerContainer too""" |
442 | | - from testcontainers.core.container import DockerContainer |
443 | | - |
444 | | - with DockerContainer("hello-world") as container: |
445 | | - info = container.get_container_info() |
446 | | - assert info is not None |
447 | | - assert info.Id is not None |
448 | | - assert info.Image is not None |
449 | | - |
450 | | - if info.State: |
451 | | - assert hasattr(info.State, "Status") |
452 | | - assert hasattr(info.State, "Running") |
453 | | - |
454 | | - if info.Config: |
455 | | - assert hasattr(info.Config, "Image") |
456 | | - assert hasattr(info.Config, "Hostname") |
457 | | - |
458 | | - network_settings = info.get_network_settings() |
459 | | - if network_settings: |
460 | | - assert hasattr(network_settings, "IPAddress") |
461 | | - assert hasattr(network_settings, "Networks") |
0 commit comments