[UPD] Exception handling

This commit is contained in:
2026-02-15 20:53:32 +01:00
parent 2a8a44e80b
commit 969333998c
17 changed files with 105 additions and 81 deletions

View File

@@ -7,11 +7,13 @@ from app.api.actions import install
from app.schema.library import Library, Tag, Book, BookTag, Path, Env
from app.controller import LibraryController
from app.controller.exceptions import LibraryReadException
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
class TestDB(unittest.TestCase):
class TestController(unittest.TestCase):
def setUp(self):
os.environ["DEV_URIA_BIBLIOGAME_CONFIG_DB"] = "sqlite:///"
@@ -141,7 +143,7 @@ class TestDB(unittest.TestCase):
library = LibraryController(1, engine=self.engine)
library.delete()
self.assertRaises(NoResultFound, LibraryController, 1, engine=self.engine)
self.assertRaises(LibraryReadException, LibraryController, 1, engine=self.engine)
if __name__ == "__main__":
unittest.main()