Exemplo n.º 1
0
    def test_search_true(self):

        totalbooks = get_books("The Secret Keeper")
        self.assertEquals(totalbooks, ["The Secret Keeper"])
        totalbooks1 = get_books("A Touch of Dead")
        self.assertEquals(totalbooks, ["A Touch of Dead"])
        totalbooks2 = get_books("The Brothers K")
        self.assertEquals(totalbooks, ["The Brothers K"])
        totalbooks3 = get_books("The Lightning Thief")
        self.assertEquals(totalbooks, ["The Lightning Thief"])
Exemplo n.º 2
0
 def test_valid(self):
     books = get_books('I, Robo', 'Title')
     for book in books:
         self.assertEqual(book.title,'I, Robot')
Exemplo n.º 3
0
 def test_invalid(self):
     book = get_books('abcd', 'None')
     self.assertEqual(len(book),0)
Exemplo n.º 4
0
 def test_valid4(self):
     books = get_books('Isaac Asimov', 'Author')
     self.assertEqual(len(books),17)
Exemplo n.º 5
0
 def test_valid3(self):
     books = get_books('009', 'Year')
     self.assertEqual(len(books),241)
Exemplo n.º 6
0
 def test_valid2(self):
     books = get_books('The Sleeping Doll', 'None')
     for book in books:
         self.assertEqual(book.year,'2007')
Exemplo n.º 7
0
 def test_valid1(self):
     books = get_books('V.C. Andrews', '')
     self.assertEqual(len(books),9)