Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions netutils/bandwidth.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def _get_bytes_mapping() -> t.Dict[str, t.Dict[str, int]]:


def _normalize_bw(speed: str) -> str:
speed = speed.replace("bit", "b")
per_second_mapping = {
"b": "bps",
"Kb": "Kbps",
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/test_bandwidth.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@

name_to_bits = [
{"sent": "10Mbps", "received": 10000000},
{"sent": "10 Mbit", "received": 10000000},
{"sent": "10 Mbps", "received": 10000000},
{"sent": "1Gbps", "received": 1000000000},
{"sent": "1 Gbit", "received": 1000000000},
{"sent": "1 Gbps", "received": 1000000000},
{"sent": "100Gbps", "received": 100000000000},
{"sent": "100 Gbit", "received": 100000000000},
{"sent": "100 Gbps", "received": 100000000000},
{"sent": "100 Gb", "received": 100000000000},
{"sent": "10GBps", "received": 80000000000},
Expand Down
Loading