aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-08-30 13:54:23 +0300
committerFrederick Muriuki Muriithi2022-08-30 13:54:23 +0300
commit45b9bcb015d2b563a82ac334be68a84ec28d0f8c (patch)
treecd1212a0b5dbce5c2417396779bd6e24ff8e21f1
parent9ef2ddca0bea793b6073f0f7cf2e691a45586fa9 (diff)
downloadgenenetwork3-45b9bcb015d2b563a82ac334be68a84ec28d0f8c.tar.gz
Update test: include port in parsed data from mysql uri
-rw-r--r--tests/unit/test_db_utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/test_db_utils.py b/tests/unit/test_db_utils.py
index 7dc66c0..68f80a0 100644
--- a/tests/unit/test_db_utils.py
+++ b/tests/unit/test_db_utils.py
@@ -18,7 +18,7 @@ class TestDatabase(TestCase):
@mock.patch("gn3.db_utils.parse_db_url")
def test_database_connector(self, mock_db_parser, mock_sql):
"""test for creating database connection"""
- mock_db_parser.return_value = ("localhost", "guest", "4321", "users")
+ mock_db_parser.return_value = ("localhost", "guest", "4321", "users", None)
callable_cursor = lambda: SimpleNamespace(execute=3)
cursor_object = SimpleNamespace(cursor=callable_cursor)
mock_sql.connect.return_value = cursor_object
@@ -26,7 +26,7 @@ class TestDatabase(TestCase):
results = database_connector()
mock_sql.connect.assert_called_with(
- "localhost", "guest", "4321", "users")
+ "localhost", "guest", "4321", "users", port=3306)
self.assertIsInstance(
results, SimpleNamespace, "database not created successfully")
@@ -36,5 +36,5 @@ class TestDatabase(TestCase):
def test_parse_db_url(self):
"""test for parsing db_uri env variable"""
results = parse_db_url()
- expected_results = ("localhost", "username", "4321", "test")
+ expected_results = ("localhost", "username", "4321", "test", None)
self.assertEqual(results, expected_results)