def test_process_page(self, mock_put_extracted_pages_in_queue, mock_put_extracted_items_in_queue):
     self.page_processor.request_sender.get_element.return_value = "<html><br>Page title</br></html>"
     mock_page = mock_factory.create_mock_page()
     mock_page.url = "http://test.com/link/to/example_page.html"
     self.page_processor.process_page(mock_page)
     self.assertEquals(mock_page.content, "<html><br>Page title</br></html>")
     mock_put_extracted_pages_in_queue.assert_called_once_with(mock_page)
     mock_put_extracted_items_in_queue.assert_called_once_with(mock_page)
 def test_put_extracted_items_in_queue(self):
     mock_page = mock_factory.create_mock_page()
     mock_extracted_items = [mock.Mock()] * 10
     mock_page.extract_items.return_value = mock_extracted_items
     self.page_processor.put_extracted_items_in_queue(mock_page)
     self.assertEquals(self.page_processor.items_queue.put.call_count, len(mock_extracted_items))