-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_docker.py
More file actions
38 lines (30 loc) · 873 Bytes
/
test_docker.py
File metadata and controls
38 lines (30 loc) · 873 Bytes
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
30
31
32
33
34
35
36
37
38
# pylint: disable=unused-import, redefined-outer-name
from pathlib import Path
import docker
import pytest
from golem_task_api import TaskApiService
from tutorial_app import constants
from .base import (
SimulationBase,
task_lifecycle_util,
)
from .docker import (
is_docker_available,
DockerTaskApiService,
)
@pytest.mark.skipif(not is_docker_available(), reason='docker not available')
class TestDocker(SimulationBase):
IMAGE = f"{constants.DOCKER_IMAGE}:test"
@classmethod
def setup_class(cls):
docker.from_env().images.build(
path=str(Path(__file__).parent.parent / 'image'),
tag=cls.IMAGE,
)
def _get_task_api_service(
self,
work_dir: Path,
) -> TaskApiService:
return DockerTaskApiService(
image=self.IMAGE,
work_dir=work_dir)