patch _get_docker_client in testfiles

This commit is contained in:
Robert Kaussow 2020-03-16 20:12:55 +01:00
parent 5768351773
commit dc1760b12c
2 changed files with 14 additions and 2 deletions

View File

@ -11,7 +11,13 @@ pytest_plugins = [
@pytest.fixture @pytest.fixture
def autostop(): def autostop(mocker):
mocker.patch.object(
Autostop.AutoStop,
"_get_docker_client",
return_value=mocker.create_autospec(docker.APIClient)
)
stop = Autostop.AutoStop() stop = Autostop.AutoStop()
return stop return stop

View File

@ -12,7 +12,13 @@ pytest_plugins = [
@pytest.fixture @pytest.fixture
def gc(): def gc(mocker):
mocker.patch.object(
GarbageCollector.GarbageCollector,
"_get_docker_client",
return_value=mocker.create_autospec(docker.APIClient)
)
gc = GarbageCollector.GarbageCollector() gc = GarbageCollector.GarbageCollector()
return gc return gc