[UPD] Delete Library

This commit is contained in:
2026-02-15 16:34:43 +01:00
parent c701a4ab9b
commit 7c3593d066
4 changed files with 20 additions and 7 deletions

View File

@@ -2,11 +2,13 @@ import os
import unittest
from sqlalchemy.orm import sessionmaker
from sqlalchemy.exc import NoResultFound
from app.api.actions import install
from app.api.cruds.base import create, read, update
from app.api.cruds.base import create, read, update, delete
from app.schema.library import Library, Path, Env, Book, Tag, BookTag
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
@@ -135,7 +137,13 @@ class TestDB(unittest.TestCase):
self.assertEqual(book.name, self.library.books[0].name)
self.assertNotEqual(book.name, "Test book")
self.assertEqual(book.name, "Another Book on the shelf")
self.assertEqual(book.name, "Another Book on the shelf")
def test_delete_library(self):
library = read(self.session, 1, Library)
delete(self.session, library)
self.assertRaises(NoResultFound, read, self.session, 1, Library)
if __name__ == "__main__":