def setUp(self): set_up(self) amazon.Request = Mock() amazon.urlopen().read = Mock(return_value=reviewers_table) product = Product('http://fake') product._number_of_review_pages = Mock(return_value=2) self.product = product
def setUp(self): set_up(self) amazon.Request = Mock() amazon.urlopen().read = Mock(return_value=reviewers_table)
def test_number_of_pages_on_html_string_five_pages(self): amazon.urlopen().read = Mock(return_value=five_pages) number = Product(self.url)._number_of_review_pages(1) self.assertEqual(number, 5)