blob: 7217fe07a3ff199d84b39ec954cd689ac5dee14f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
from __future__ import print_function
import sys
import warnings
import docker.errors
from docker.utils import kwargs_from_env
import pytest
from .base import BUSYBOX
@pytest.fixture(autouse=True, scope='session')
def setup_test_session():
warnings.simplefilter('error')
c = docker.APIClient(**kwargs_from_env())
try:
c.inspect_image(BUSYBOX)
except docker.errors.NotFound:
print("\npulling {0}".format(BUSYBOX), file=sys.stderr)
for data in c.pull(BUSYBOX, stream=True, decode=True):
status = data.get("status")
progress = data.get("progress")
detail = "{0} - {1}".format(status, progress)
print(detail, file=sys.stderr)
# Double make sure we now have busybox
c.inspect_image(BUSYBOX)
c.close()
|