From b4e0d03d957b5847976dce9d0dca7e1b8a3245d4 Mon Sep 17 00:00:00 2001 From: Antoni Ivanov Date: Sat, 21 May 2022 14:11:00 +0300 Subject: [PATCH] vdk-core: fix buggy (false positive) connection unit test We have a unit test that checks the raw (or native) connection is being saved properly - but the test was buggy since they are qual in a sense they have the same attribute values (as there's only one "is_valid") . But we care if it's the same instance. So we switch to "is" Testing Done: After changing == to "is" ran the test and it failed (as it should) and then fix the test. Signed-off-by: Antoni Ivanov --- .../builtin_plugins/connection/test_connection_router.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/vdk-core/tests/vdk/internal/builtin_plugins/connection/test_connection_router.py b/projects/vdk-core/tests/vdk/internal/builtin_plugins/connection/test_connection_router.py index 4c63b35630..45beffea92 100644 --- a/projects/vdk-core/tests/vdk/internal/builtin_plugins/connection/test_connection_router.py +++ b/projects/vdk-core/tests/vdk/internal/builtin_plugins/connection/test_connection_router.py @@ -45,7 +45,7 @@ def test_router_raw_connection(): router.add_open_connection_factory_method("RAW_DB", lambda: mock_conn) conn = router.open_connection("RAW_DB") - assert mock_conn == conn.connect() + assert mock_conn is conn._connect() def test_router_open_connection_closed():