Skip to content

Commit

Permalink
unittest: test get_maker
Browse files Browse the repository at this point in the history
  • Loading branch information
octohuguesdumont committed Jul 11, 2024
1 parent 1136ce8 commit fd09ae3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/sql_api/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
import pytest

from .. import sql_api
from . import database



def test_database():
database.maker = None
with pytest.raises(Exception) as e:
database.get_maker()
assert "You need to init the db by giving me a valid URL" in str(e.value)

database.init_db("sqlite:///:memory:")

maker = database.get_maker()
assert maker is not None

def test_create_user(db_api_session):
db_user = sql_api.create_user(
Expand Down

0 comments on commit fd09ae3

Please sign in to comment.