Skip to content

Commit

Permalink
added traverse() unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
anubhuti24 committed Mar 27, 2024
1 parent c2b645f commit 11f4ad4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libsql_graph_db/tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
remove_node,
connect_nodes,
connect_many_nodes,
traverse,
)


Expand Down Expand Up @@ -79,6 +80,13 @@ def test_remove_nodes(mock_atomic, mock_db_connection_and_cursor):
mock_cursor.execute.assert_called()


def test_traverse_node(mock_db_connection_and_cursor):
mock_connection, mock_cursor = mock_db_connection_and_cursor
traverse_path = traverse(src=1, tgt=2)
mock_cursor.execute.assert_called()
assert traverse_path == []


def test_find_node(mock_atomic, mock_db_connection_and_cursor):
mock_connection, mock_cursor = mock_db_connection_and_cursor
mock_cursor.fetchone.return_value = '{"id": 1, "name": "Alice", "age": 30}'
Expand Down

0 comments on commit 11f4ad4

Please sign in to comment.