コード例 #1
0
 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)
コード例 #2
0
 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')
コード例 #3
0
 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')
コード例 #4
0
 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', '')
コード例 #5
0
 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'])