add sandbox network auto-create and restore dind compose
This commit is contained in:
parent
43bd4bcbff
commit
06271db003
4 changed files with 65 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import asyncio
|
||||
import json
|
||||
from datetime import UTC, datetime, timedelta
|
||||
from typing import Any
|
||||
from uuid import UUID
|
||||
|
||||
import pytest
|
||||
|
|
@ -109,10 +110,22 @@ class FakeDockerClient(DockerClient):
|
|||
self.base_url = base_url
|
||||
self.close_calls = 0
|
||||
|
||||
@property # type: ignore[override]
|
||||
def networks(self) -> Any:
|
||||
return _FakeNetworks()
|
||||
|
||||
def close(self) -> None:
|
||||
self.close_calls += 1
|
||||
|
||||
|
||||
class _FakeNetworks:
|
||||
def get(self, name: str) -> None:
|
||||
return None
|
||||
|
||||
def create(self, name: str) -> None:
|
||||
return None
|
||||
|
||||
|
||||
class EmptySandboxState:
|
||||
def __init__(self) -> None:
|
||||
self.calls = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue