Skip to content

Commit caf236e

Browse files
committed
FakeClient: Use MagicMock instead of actually channel
This decreases dependencies and prevents problems later on with solipsism and time_machine. Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent a71c0c6 commit caf236e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/frequenz/client/dispatch/test/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"""Fake client for testing."""
55

66
from typing import Any, cast
7-
8-
import grpc.aio
7+
from unittest.mock import MagicMock
98

109
from frequenz.client.dispatch import Client
1110
from frequenz.client.dispatch.test._service import FakeService
@@ -20,7 +19,7 @@ class FakeClient(Client):
2019

2120
def __init__(self) -> None:
2221
"""Initialize the mock client."""
23-
super().__init__(grpc.aio.insecure_channel("mock"), "mock")
22+
super().__init__(MagicMock(), "mock")
2423
self._stub = FakeService() # type: ignore
2524

2625
@property

0 commit comments

Comments
 (0)