def test51_userbook_add_collection_wrong_collection_type_fail(self): book = UserBook(**self.user_book_kwargs) with self.assertRaises(AssertionError): book.add_collection_name('new user', 7777)
def test50_userbook_add_collection_wrong_user_type_fail(self): book = UserBook(**self.user_book_kwargs) with self.assertRaises(AssertionError): book.add_collection_name(1337, 'new_collection')
def test47_userbook_add_collection_name_missing_arg_fail(self): book = UserBook(**self.user_book_kwargs) with self.assertRaises(TypeError): book.add_collection_name('new user')
def test49_userbook_add_collection_name_empty_collection_name_fail(self): book = UserBook(**self.user_book_kwargs) with self.assertRaises(AssertionError): book.add_collection_name('new user', '')
def test46_userbook_add_collection_name_success(self): book = UserBook(**self.user_book_kwargs) book.add_collection_name('new user', 'new collection') self.assertEqual(book.in_collections['new user'], ['new collection'])