Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
neelasha23 committed Aug 15, 2023
1 parent 7aa0aeb commit f08aa6e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/tests/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from sql.connection import SQLAlchemyConnection, ConnectionManager
from IPython.core.error import UsageError
from sql import store
from sql import store_utils
from sqlalchemy import create_engine


Expand Down Expand Up @@ -322,25 +323,25 @@ def test_branch(is_dialect_support_backtick, monkeypatch):


def test_get_all_keys(ip_snippets):
keys = store.get_all_keys()
keys = store_utils.get_all_keys()
assert "a" in keys
assert "b" in keys
assert "c" in keys


def test_get_key_dependents(ip_snippets):
keys = store.get_key_dependents("a")
keys = store_utils.get_key_dependents("a")
assert "b" in keys
assert "c" in keys


def test_del_saved_key(ip_snippets):
keys = store.del_saved_key("c")
keys = store_utils.del_saved_key("c")
assert "a" in keys
assert "b" in keys


def test_del_saved_key_error(ip_snippets):
with pytest.raises(UsageError) as excinfo:
store.del_saved_key("non_existent_key")
store_utils.del_saved_key("non_existent_key")
assert "No such saved snippet found : non_existent_key" in str(excinfo.value)

0 comments on commit f08aa6e

Please sign in to comment.