예제 #1
0
파일: test_ical.py 프로젝트: kennym/itools
    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
파일: test_ical.py 프로젝트: kennym/itools
 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
파일: test_ical.py 프로젝트: kennym/itools
    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'), [])