mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-02-16 10:29:36 +01:00
add getaddrinfo mock for test-cases with hosts
This commit is contained in:
parent
2f026c84af
commit
19e2a1810d
@ -27,6 +27,15 @@ _ip6_reprs = {
|
||||
_ip6_swidths = (48, 64, 96, 115, 128)
|
||||
|
||||
|
||||
def _mock_getaddrinfo(host, *_):
|
||||
return {
|
||||
"example.com": [
|
||||
(socket.AF_INET6, socket.SOCK_STREAM, 0, '', ('2606:2800:220:1:248:1893:25c8:1946', 0, 0, 0)),
|
||||
(socket.AF_INET, socket.SOCK_STREAM, 0, '', ('93.184.216.34', 0)),
|
||||
],
|
||||
}.get(host, [])
|
||||
|
||||
|
||||
def test_parse_subnetport_ip4():
|
||||
for ip_repr, ip in _ip4_reprs.items():
|
||||
assert sshuttle.options.parse_subnetport(ip_repr) \
|
||||
|
Loading…
Reference in New Issue
Block a user