-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4cefda2
commit 09fc4ce
Showing
3 changed files
with
45 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import sys | ||
from unittest.mock import MagicMock | ||
|
||
|
||
class _TGVoIP(MagicMock): | ||
@classmethod | ||
def __getattr__(cls, name): | ||
if name in ['Stats', 'Endpoint']: | ||
return getattr(_TGVoIP, name) | ||
elif name in ['__loader__', '__file__']: | ||
return None | ||
|
||
return MagicMock() | ||
|
||
class Stats: | ||
""" | ||
Object storing call stats | ||
Attributes: | ||
bytes_sent_wifi (``int``): Amount of data sent over WiFi | ||
bytes_sent_mobile (``int``): Amount of data sent over mobile network | ||
bytes_recvd_wifi (``int``): Amount of data received over WiFi | ||
bytes_recvd_mobile (``int``): Amount of data received over mobile network | ||
""" | ||
pass | ||
|
||
class Endpoint: | ||
""" | ||
Object storing endpoint info | ||
Args: | ||
_id (``int``): Endpoint ID | ||
ip (``str``): Endpoint IPv4 address | ||
ipv6 (``str``): Endpoint IPv6 address | ||
port (``int``): Endpoint port | ||
peer_tag (``bytes``): Endpoint peer tag | ||
""" | ||
pass | ||
|
||
|
||
sys.modules.update(_tgvoip=_TGVoIP()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters