From 2f026c84af9b471c407261756b3ec7c32f203282 Mon Sep 17 00:00:00 2001 From: mangano-ito <47137677+mangano-ito@users.noreply.github.com> Date: Tue, 18 Jan 2022 16:56:58 +0900 Subject: [PATCH] test hosts with port specified --- tests/client/test_options.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/client/test_options.py b/tests/client/test_options.py index 1b5f4a7..c367213 100644 --- a/tests/client/test_options.py +++ b/tests/client/test_options.py @@ -113,3 +113,16 @@ def test_parse_subnetport_host(): (socket.AF_INET6, '2606:2800:220:1:248:1893:25c8:1946', 128, 0, 0), (socket.AF_INET, '93.184.216.34', 32, 0, 0), ]) + + +def test_parse_subnetport_host_with_port(): + assert set(sshuttle.options.parse_subnetport('example.com:80')) \ + == set([ + (socket.AF_INET6, '2606:2800:220:1:248:1893:25c8:1946', 128, 80, 80), + (socket.AF_INET, '93.184.216.34', 32, 80, 80), + ]) + assert set(sshuttle.options.parse_subnetport('example.com:80-90')) \ + == set([ + (socket.AF_INET6, '2606:2800:220:1:248:1893:25c8:1946', 128, 80, 90), + (socket.AF_INET, '93.184.216.34', 32, 80, 90), + ])