Skip to content

Commit

Permalink
vdk-core: fix buggy (false positive) connection unit test
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
antoniivanov committed May 21, 2022
1 parent b2f2c9f commit b4e0d03
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit b4e0d03

Please sign in to comment.