Skip to content

Commit

Permalink
fixed merge error
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki committed Jun 15, 2023
1 parent 70a54cc commit a824b17
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions test/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import pytest

from exasol_integration_test_docker_environment.lib.docker import ContextDockerClient
from exasol_integration_test_docker_environment.testing import utils
from exasol_integration_test_docker_environment \
.testing.api_test_environment import ApiTestEnvironment
Expand Down Expand Up @@ -100,3 +101,19 @@ def create_context(
utils.close_environments(spawned)

return create_context


def exact_matcher(names):
return lambda value: all(x == value for x in names)


def superset_matcher(names):
return lambda value: all(x in value for x in names)


@contextlib.contextmanager
def container_named(*names, matcher=None):
matcher = matcher if matcher else exact_matcher(names)
with ContextDockerClient() as client:
matches = [c for c in client.containers.list() if matcher(c.name)]
yield matches[0] if matches else None
2 changes: 1 addition & 1 deletion test/integration/test_ssh_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import pytest

from conftest import container_named
from .conftest import container_named
from exasol_integration_test_docker_environment.lib.base.ssh_access import SshKey, SshKeyCache


Expand Down

0 comments on commit a824b17

Please sign in to comment.