def run(self):
        eml = ExtractMinutesList()
        with self.input().open("r") as I:
            minute_year_index = pickle.load(I)

            index = extract_index_from_url(minute_year_index[self.date.year])

            minutes_url_map = eml.year_minutes_list(index)
            with self.output().open("w") as O:
                pickle.dump(minutes_url_map, O)
    def test_minutes_list_files(self):
        index = 4187317
        eml = ExtractMinutesList()

        path = base_resources+'minutes_list.html'
        with open(path, 'r') as f:
            src = f.read()
            eml.url = None
            x = eml.year_minutes_list(index, src=src)
            #print(pformat(x), file=stderr)
            self.assertGreater(len(x), 10)
            self.assertIn(datetime.datetime(2011, 12, 21, 0, 0), x)
 def test_minutes_list_query(self):
     eml = ExtractMinutesList()
     x = eml.minutes_list_url(4187317)
     print(x)
     self.assertEqual(x, 'http://efiles.portlandoregon.gov/webdrawer.dll/webdrawer/search/rec?sort1=rs_datecreated&rows=100&sm_ncontents=uri_4187317&template=reclist_contents')