def test_events_for_daterange(self):
        """
        Testing event parsing for multiple TA monthly calendars
        """

        file_opener = testutils.build_file_urlopener("http:", test_data_root)
        ta = TransaltEventDao(urlopener=file_opener.open)

        def events(d1, d2):
            return list(ta.events_for_daterange(d1, d2, 999999))

        def jun(d):
            return datetime(2014, 6, d)

        # snapshot has jun data
        self.assertEqual(0, len(events(jun(30), jun(01))))
        self.assertEqual(0, len(events(jun(01), jun(01))))
        self.assertEqual(1, len(events(jun(10), jun(15))))
        self.assertEqual(5, len(events(jun(01), jun(30))))

        # missing data test coverage
        with self.assertRaises(IOError):
            events(datetime(2014, 7, 01), datetime(2014, 7, 01))

        with self.assertRaises(IOError):
            events(datetime(2014, 5, 31), datetime(2014, 5, 31))

        with self.assertRaises(IOError):
            events(datetime(2014, 5, 31), datetime(2014, 7, 01))
    def test_events_for_calendar(self):
        """
        Testing event parsing for a single monthly TA calendar
        """

        file_opener = testutils.build_file_urlopener("http:", test_data_root)
        ta = TransaltEventDao(urlopener=file_opener.open)

        test_calendar_url = "http://transalt.org/calendar/2014/06"
        events = list(ta.events_for_calendar(test_calendar_url))

        self.assertEqual(5, len(list(events)), 5)
        self.assertEqual("7310", os.path.basename(events[0].url))
        self.assertEqual("7515", os.path.basename(events[1].url))
        self.assertEqual("7276", os.path.basename(events[2].url))
        self.assertEqual("7516", os.path.basename(events[3].url))
        self.assertEqual("7286", os.path.basename(events[4].url))