Example #1
0
 def setUp(self):
     self.__html_spy = HtmlRequestHandlerSpy()
     self.__opds_spy = OpdsRequestHandlerSpy()
     RequestHandlerTestBase.initialise_app_mock(self)
     self.__r = RequestHandler(self.app)
     self.__r.set_html_request_handler(self.__html_spy)
     self.__r.set_opds_request_handler(self.__opds_spy)
 def __initialise_app_mock(self):
     RequestHandlerTestBase.initialise_app_mock(self)
     b = self.__get_mock_book()
     self.app.search_books = Mock()
     self.app.get_book_details = Mock(return_value=b)
     self.app.get_book_type = Mock()
     self.app.list_books_by_first_letter = Mock()
 def setUp(self):
     RequestHandlerTestBase.initialise_app_mock(self)
     self.app.get_book_details = Mock(return_value=(Book()))
     self.__book_handler = HtmlRequestHandlerBook(self.app)
 def initialise_app_mock(self):
     RequestHandlerTestBase.initialise_app_mock(self)
     self.app.search_books = Mock(return_value=[])
 def initialise_app_mock(self):
     RequestHandlerTestBase.initialise_app_mock(self)
     self.app.harvest_books = Mock(return_value=None)
 def test_can_instantiate(self):
     RequestHandlerTestBase.initialise_app_mock(self)
     HtmlRequestHandlerIndex(self.app)
 def initialise_app_mock(self):
     RequestHandlerTestBase.initialise_app_mock(self)
     self.app.list_books_by_first_letter = Mock(return_value=[])