From 9b4c44bba9687d88d0b77fa2fc92f97af7f82107 Mon Sep 17 00:00:00 2001 From: Leo Q Date: Sat, 14 Sep 2024 12:14:57 +0800 Subject: [PATCH] add tests for ssh tunnel --- sql/utils/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/utils/tests.py b/sql/utils/tests.py index 6ece20636b..f88d6d8a3d 100644 --- a/sql/utils/tests.py +++ b/sql/utils/tests.py @@ -39,6 +39,7 @@ from sql.utils.execute_sql import execute, execute_callback from sql.utils.tasks import add_sql_schedule, del_schedule, task_info from sql.utils.data_masking import data_masking, brute_mask, simple_column_mask +from sql.utils.ssh_tunnel import SSHConnection User = Users __author__ = "hhyo" @@ -1512,3 +1513,8 @@ def test_auth_group_users(self): auth_group_names=[self.agp.name], group_id=self.rgp1.group_id ) self.assertIn(self.user, users) + +# ssh tunnel tests +def test_get_local_ip(): + tunnel = SSHConnection("mysql", 3306, "tunnel", 22, "root", "password", "", "") + assert tunnel.get_local_ip() != "127.0.0.1"