How to use the sshtunnel._bindlist function in sshtunnel

To help you get started, we’ve selected a few sshtunnel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pahaz / sshtunnel / tests / test_forwarder.py View on Github external
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(':')
github pahaz / sshtunnel / tests / test_forwarder.py View on Github external
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(':')
github pahaz / sshtunnel / tests / test_forwarder.py View on Github external
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(':')
github pahaz / sshtunnel / tests / test_forwarder.py View on Github external
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(':')
github pahaz / sshtunnel / tests / test_forwarder.py View on Github external
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(':')