Total Complexity | 6 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from typing import Any, Self |
||
2 | |||
3 | |||
4 | class MockWritable: |
||
5 | def __init__(self: Self) -> None: |
||
6 | self.data = None |
||
7 | |||
8 | def write(self, data: Any) -> int: |
||
9 | self.data = "write:" + str(data) |
||
10 | return len(data) |
||
11 | |||
12 | def flush(self: Self) -> None: |
||
13 | self.data += "flush" |
||
14 | |||
15 | def close(self: Self) -> None: |
||
16 | self.data += "close" |
||
17 | |||
18 | |||
19 | class MockCallable: |
||
20 | def __init__(self: Self) -> None: |
||
21 | self.data = None |
||
22 | |||
23 | def __call__(self, data: Self) -> None: |
||
24 | self.data = "call:" + data |
||
25 | |||
26 | |||
27 | class WritableCallable(MockWritable, MockCallable): |
||
28 | pass |
||
29 |