Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from import BookDB,Book
class TestBookDatabase:
def setup(self):
self.bookDatabaseClient = BookDB()
def test_default_database_length(self):
assert self.bookDatabaseClient.books.__len__() is 2
def test_all(self):
assert self.bookDatabaseClient.all().__len__() is 2
assert self.bookDatabaseClient.all().__len__() is 0
def test_insert(self):
assert self.bookDatabaseClient.books.__len__() is 2
book = Book('La Colmena','Camilo José Cela')
assert self.bookDatabaseClient.books.__len__() is 3
assert == 3
def test_one(self):
book =
assert book is not None
assert is 1
assert == 'Miguel de Cervantes'
assert book.title == 'Don Quijote de la Mancha'
new_book = Book('La Colmena', 'Camilo José Cela')
book =
assert is
assert new_book.title == book.title
assert ==
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment