Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
radupotop committed Apr 13, 2024
1 parent c5a9918 commit 26e89a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app/backend/db.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from functools import cache
from pathlib import Path

from peewee import Database, SqliteDatabase

Expand All @@ -9,6 +8,4 @@ def init_db(path: str) -> Database:
"""
Singleton to init database from file.
"""
if not Path(path).is_file():
raise RuntimeError('Database file not found')
return SqliteDatabase(path)
2 changes: 2 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@

from app.api import init
from app.api.web import application
from app.bootstrap.bootstrap import create_db


class TestAPI:
def setup_class(self):
storage, ipt, self.cfg = init()
create_db(storage.get_db())
ipt.setup_whitelist_chain()
self.client = Client(application)
self.token = storage.add_token()
Expand Down
2 changes: 2 additions & 0 deletions tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import pytest

from app.api import init
from app.bootstrap.bootstrap import create_db

storage, _, _ = init()
create_db(storage.get_db())


class TestToken:
Expand Down

0 comments on commit 26e89a8

Please sign in to comment.