Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions arangodb/tests/test_arangodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_docker_run_arango():
"""
Test ArangoDB container with default settings.
"""
image_version = '3.9.1'
image_version = '3.10.6'
image = f'{ARANGODB_IMAGE_NAME}:{image_version}'
arango_root_password = 'passwd'

Expand All @@ -70,7 +70,7 @@ def test_docker_run_arango_without_auth():
"""
Test ArangoDB container with ARANGO_NO_AUTH var set.
"""
image_version = '3.9.1'
image_version = '3.10.6'
image = f'{ARANGODB_IMAGE_NAME}:{image_version}'

with ArangoDbContainer(image, arango_no_auth=True) as arango:
Expand Down Expand Up @@ -107,7 +107,7 @@ def test_docker_run_arango_random_root_password():
"""
Test ArangoDB container with ARANGO_RANDOM_ROOT_PASSWORD var set.
"""
image_version = '3.9.1'
image_version = '3.10.6'
image = f'{ARANGODB_IMAGE_NAME}:{image_version}'
arango_root_password = 'passwd'

Expand Down
4 changes: 2 additions & 2 deletions elasticsearch/tests/test_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from testcontainers.elasticsearch import ElasticSearchContainer


# The versions below were the current supported versions at time of writing (2022-08-11)
@pytest.mark.parametrize('version', ['6.8.23', '7.17.5', '8.3.3'])
# The versions below should reflect the latest stable releases of maintained versions
@pytest.mark.parametrize('version', ['7.17.10', '8.7.1'])
def test_docker_run_elasticsearch(version):
with ElasticSearchContainer(f'elasticsearch:{version}') as es:
resp = urllib.request.urlopen(es.get_url())
Expand Down
5 changes: 3 additions & 2 deletions nginx/tests/test_nginx.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import requests
from testcontainers.core.waiting_utils import wait_for_logs

from testcontainers.nginx import NginxContainer


def test_docker_run_nginx():
nginx_container = NginxContainer("nginx:1.13.8")
with nginx_container as nginx:
with NginxContainer("nginx:1.24.0") as nginx:
wait_for_logs(nginx, 'ready for start up')
url = f"http://{nginx.get_container_host_ip()}:{nginx.get_exposed_port(nginx.port)}/"
r = requests.get(url)
assert (r.status_code == 200)
Expand Down
15 changes: 8 additions & 7 deletions redis/tests/test_redis.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import time
from testcontainers.core.waiting_utils import wait_for_logs

from testcontainers.redis import RedisContainer


def test_docker_run_redis():
config = RedisContainer()
with config as redis:
with RedisContainer('redis:7.0.11') as redis:
wait_for_logs(redis, 'Ready to accept connections')
client = redis.get_client()
p = client.pubsub()
p.subscribe('test')
pubsub = client.pubsub()
pubsub.subscribe('test')
client.publish('test', 'new_msg')
msg = wait_for_message(p)
msg = wait_for_message(pubsub)
assert 'data' in msg
assert b'new_msg', msg['data']


def test_docker_run_redis_with_password():
config = RedisContainer(password="mypass")
with config as redis:
with RedisContainer('redis:7.0.11', password="mypass") as redis:
wait_for_logs(redis, 'Ready to accept connections')
client = redis.get_client(decode_responses=True)
client.set("hello", "world")
assert client.get("hello") == "world"
Expand Down