def test_MinutesDateParsedCorrectly(self): wrapper = PhillyLegistarSiteWrapper() expected_date = dt.date(2083, 12, 6) # They learned nothing from Y2K taken_date = wrapper.get_minutes_date('http://www.bogus.com/path/mydoc_83-12-06_bill.pdf') self.assertEqual(taken_date, expected_date)
def test_MinutesDateParsedCorrectly(self): wrapper = PhillyLegistarSiteWrapper(root_url='') expected_date = dt.date(2083, 12, 6) # They learned nothing from Y2K taken_date = wrapper.get_minutes_date( 'http://www.bogus.com/path/mydoc_83-12-06_bill.pdf') self.assertEqual(taken_date, expected_date)
def test_MinutesDocumentConstructedCorrectly(self): wrapper = PhillyLegistarSiteWrapper() wrapper.get_minutes_date = mock.Mock(return_value=dt.date(2083, 12, 6)) wrapper.extract_pdf_text = mock.Mock(return_value='This is the text') expected_doc = {'url': 'http://www.example.com/doc.pdf', 'fulltext': 'This is the text', 'date_taken': dt.date(2083, 12, 6)} minutes_doc = wrapper.get_minutes_doc('http://www.example.com/doc.pdf') self.assertEqual(minutes_doc, expected_doc)
def test_MinutesDocumentConstructedCorrectly(self): wrapper = PhillyLegistarSiteWrapper(root_url='') wrapper.get_minutes_date = mock.Mock(return_value=dt.date(2083, 12, 6)) wrapper.extract_pdf_text = mock.Mock(return_value='This is the text') expected_doc = { 'url': 'http://www.example.com/doc.pdf', 'fulltext': 'This is the text', 'date_taken': dt.date(2083, 12, 6) } minutes_doc = wrapper.get_minutes_doc('http://www.example.com/doc.pdf') self.assertEqual(minutes_doc, expected_doc)