support/testing: add python-docker test

Python-docker needs a working docker setup to do anything useful, so add it
to the existing docker_compose (which tests docker and docker-compose)
rather than adding a completely new test.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Reviewed-by: Christian Stewart <christian@aperture.us>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Peter Korsgaard
2023-06-16 08:04:20 +02:00
parent ba9de70c28
commit 0bb63c6f5a
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
import docker
client = docker.from_env()
info = client.info()
images = client.images.list()
assert len(images) > 0
print('Version:', info['ServerVersion'])
print('Images:')
for i in images:
print(i.tags[0])