def setUp(self): src = iCalendar(string=content) src = StringIO(src.to_str()) cal = icalendarTable() cal.load_state_from_ical_file(src) self.cal1 = cal src = iCalendar(string=content2) src = StringIO(src.to_str()) cal = icalendarTable() cal.load_state_from_ical_file(src) self.cal2 = cal
def test_add_to_calendar(self): """Test to add property and component to an empty icalendar object. """ cal = icalendarTable() cal.add_record({'type': 'VEVENT'}) self.assertEqual(len(cal.get_components('VEVENT')), 1)
def test_new(self): cal = icalendarTable() # Test components self.assertEqual(len(cal.get_components()), 0) self.assertEqual(cal.get_components('VEVENT'), [])