Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_bindlist(self):
"""
Test that _bindlist enforces IP:PORT format for local and remote binds
"""
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1:8080'),
('10.0.0.1', 8080))
# Missing port in tuple is filled with port 22
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1:'),
('10.0.0.1', 22))
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1'),
('10.0.0.1', 22))
with self.assertRaises(argparse.ArgumentTypeError):
sshtunnel._bindlist('10022:10.0.0.1:22')
with self.assertRaises(argparse.ArgumentTypeError):
sshtunnel._bindlist(':')
def test_bindlist(self):
"""
Test that _bindlist enforces IP:PORT format for local and remote binds
"""
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1:8080'),
('10.0.0.1', 8080))
# Missing port in tuple is filled with port 22
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1:'),
('10.0.0.1', 22))
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1'),
('10.0.0.1', 22))
with self.assertRaises(argparse.ArgumentTypeError):
sshtunnel._bindlist('10022:10.0.0.1:22')
with self.assertRaises(argparse.ArgumentTypeError):
sshtunnel._bindlist(':')
def test_bindlist(self):
"""
Test that _bindlist enforces IP:PORT format for local and remote binds
"""
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1:8080'),
('10.0.0.1', 8080))
# Missing port in tuple is filled with port 22
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1:'),
('10.0.0.1', 22))
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1'),
('10.0.0.1', 22))
with self.assertRaises(argparse.ArgumentTypeError):
sshtunnel._bindlist('10022:10.0.0.1:22')
with self.assertRaises(argparse.ArgumentTypeError):
sshtunnel._bindlist(':')
def test_bindlist(self):
"""
Test that _bindlist enforces IP:PORT format for local and remote binds
"""
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1:8080'),
('10.0.0.1', 8080))
# Missing port in tuple is filled with port 22
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1:'),
('10.0.0.1', 22))
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1'),
('10.0.0.1', 22))
with self.assertRaises(argparse.ArgumentTypeError):
sshtunnel._bindlist('10022:10.0.0.1:22')
with self.assertRaises(argparse.ArgumentTypeError):
sshtunnel._bindlist(':')
def test_bindlist(self):
"""
Test that _bindlist enforces IP:PORT format for local and remote binds
"""
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1:8080'),
('10.0.0.1', 8080))
# Missing port in tuple is filled with port 22
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1:'),
('10.0.0.1', 22))
self.assertTupleEqual(sshtunnel._bindlist('10.0.0.1'),
('10.0.0.1', 22))
with self.assertRaises(argparse.ArgumentTypeError):
sshtunnel._bindlist('10022:10.0.0.1:22')
with self.assertRaises(argparse.ArgumentTypeError):
sshtunnel._bindlist(':')