34 lines
705 B
Python
34 lines
705 B
Python
#!/usr/bin/python3
|
|
|
|
import logging
|
|
import os
|
|
|
|
import conu
|
|
|
|
import pytest
|
|
|
|
|
|
IMAGE = os.environ.get("IMAGE_NAME", "registry.fedoraproject.org/fedora")
|
|
TAG = os.environ.get("IMAGE_TAG", "latest")
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def container(request):
|
|
with conu.DockerBackend(logging_level=logging.DEBUG) as backend:
|
|
im = backend.ImageClass(IMAGE, tag=TAG)
|
|
container = im.run_via_binary(b)
|
|
yield container
|
|
container.stop()
|
|
container.delete()
|
|
|
|
|
|
class TestContainer:
|
|
def test_running(self, container):
|
|
assert container.is_running()
|
|
|
|
def test_python3(self, container):
|
|
container.execute(["python3", "-V"])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
pytest.main()
|