Skip to content

Commit

Permalink
increase test coverage of sqlitedb.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aerorahul committed Mar 6, 2024
1 parent 8b500ef commit 3c60321
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_sqlitedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ def test_remove_column(db):
assert not column_exists(db, "test_table", column_name)


def test_remove_column_raises_error_when_column_not_exists(db):
table_name = "test_table"
column_name = "vacation address"

with pytest.raises(ValueError, match=f"Column '{column_name}' does not exist in table '{table_name}'"):
db.remove_column("test_table", column_name)


def test_insert_data(db):
# Insert test data into the table
values = [2, "Bob", 35]
Expand Down

0 comments on commit 3c60321

Please sign in to comment.