[UPD] Exception handling
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user