Пример #1
0
    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
Пример #2
0
    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
Пример #3
0
 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)
Пример #4
0
    def test_new(self):
        cal = icalendarTable()

        # Test components
        self.assertEqual(len(cal.get_components()), 0)
        self.assertEqual(cal.get_components('VEVENT'), [])
Пример #5
0
 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)
Пример #6
0
    def test_new(self):
        cal = icalendarTable()

        # Test components
        self.assertEqual(len(cal.get_components()), 0)
        self.assertEqual(cal.get_components('VEVENT'), [])