def test_medium_identical_books(self): self.testdata.unpack_archive(1) self.testdata.make_duplicate(number=1) library = Library.Library() Controller.process_books(library, book_text_files=self.testdata.get_testbooks()) verification = self.testdata.verify_results(library) self.assertAlmostEqual(1.0, zTestDataManager.TestBookManager.combine_results(verification),3)
def profilethis(self): print 'Test case generated. Beginning book matching' self.library = Library.Library() start = time.time() Controller.process_books(self.library, book_text_files=self.testdata.get_testbooks()) runtime = time.time()-start #print library.print_pretty_tree() print 'Finished Processing {0} books in {1} seconds'.format(len(self.testdata.get_testbooks()),runtime)
def test_medium_big_error_compare(self): self.testdata.unpack_archive(1) e = zTestDataManager.ErrorMaker(error_rate=500, per_page_junk=True) self.testdata.make_error_dupes(number=1,errormaker=e) library = Library.Library() Controller.process_books(library, book_text_files=self.testdata.get_testbooks()) verification = self.testdata.verify_results(library) self.assertAlmostEqual(1.0, zTestDataManager.TestBookManager.combine_results(verification),3)
def test_medium_mismatched_books(self): self.testdata.unpack_archive(2) library = Library.Library() Controller.process_books(library, book_text_files=self.testdata.get_testbooks()) verification = self.testdata.verify_results(library) self.assertAlmostEqual(1.0, zTestDataManager.TestBookManager.combine_results(verification),3)
def test_long_basictest(self): #Just run through some books to be sure we don't crash library = Library.Library() Controller.process_books(library, book_text_files=self.testdata.get_testbooks()) self.assertTrue(library.get_book_count() > 0)