Skip to content

Commit ee240fe

Browse files
committed
[tests] updated dummy connections to new interface
1 parent 60866d7 commit ee240fe

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

tests/helpers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@ def faulty_parser(value: str) -> int:
66

77

88
class FaultyConnection(Connection):
9+
def send_binary(self, data: bytes) -> None:
10+
pass
11+
912
def send(self, value: str) -> None:
1013
pass
1114

15+
def receive_binary(self) -> bytes:
16+
return b""
17+
1218
def receive(self) -> str:
1319
return ""
1420

21+
def exchange_binary(self, data: bytes) -> bytes:
22+
return b""
23+
1524
def exchange(self, value: str) -> str:
1625
return ""
1726

tests/helpers_gsionline.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,21 @@ class DummyGsiOnlineConnection(Connection):
2727
def __init__(self, gsi16: bool = False):
2828
self._gsi16 = gsi16
2929

30+
def send_binary(self, data: bytes) -> None:
31+
return
32+
3033
def send(self, value: str) -> None:
3134
pass
3235

36+
def receive_binary(self) -> bytes:
37+
return b""
38+
3339
def receive(self) -> str:
3440
return ""
3541

42+
def exchange_binary(self, data: bytes) -> bytes:
43+
return b""
44+
3645
def exchange(self, cmd: str) -> str:
3746
if self._CONF.match(cmd) and cmd != "CONF/0":
3847
if cmd == "CONF/137":

tests/test_geocom.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,21 @@ class DummyGeoComConnection(Connection):
3232
r"(?:(?P<params>.*))?$"
3333
)
3434

35+
def send_binary(self, data: bytes) -> None:
36+
return
37+
3538
def send(self, message: str) -> None:
3639
return
3740

41+
def receive_binary(self) -> bytes:
42+
return b""
43+
3844
def receive(self) -> str:
3945
return ""
4046

47+
def exchange_binary(self, data: bytes) -> bytes:
48+
return b""
49+
4150
def exchange(self, cmd: str) -> str:
4251
if not self._CMD.match(cmd):
4352
return "%R1P,0,0:2"

0 commit comments

Comments
 (0)