Exemple #1
0
    def test_events_setter(self):

        c = Calendar(cal1)
        e = Event()
        c.events = [e]

        self.assertEqual(c.events, [e])
Exemple #2
0
 def test_empty_list_to_eventlist(self):
     c = Calendar()
     l = []
     c.events = l
     self.assertIsNot(c.events, l)
     self.assertIsInstance(c.events, EventList)
     self.assertSequenceEqual(c.events, l)
Exemple #3
0
 def test_list_to_eventlist(self):
     c = Calendar()
     l = [Event(), Event(), Event(name='plop')]
     c.events = l
     self.assertIsNot(c.events, l)
     self.assertIsInstance(c.events, EventList)
     self.assertSequenceEqual(c.events, l)
Exemple #4
0
 def test_list_to_eventlist(self):
     c = Calendar()
     l = [Event(), Event(), Event(name='plop')]
     c.events = l
     self.assertIsNot(c.events, l)
     self.assertIsInstance(c.events, EventList)
     self.assertSequenceEqual(sorted(c.events), sorted(l))
Exemple #5
0
    def test_events_setter(self):

        c = Calendar(cal1)
        e = Event()
        c.events = [e]

        self.assertEqual(c.events, [e])
Exemple #6
0
 def test_empty_list_to_eventlist(self):
     c = Calendar()
     l = []
     c.events = l
     self.assertIsNot(c.events, l)
     self.assertIsInstance(c.events, EventList)
     self.assertSequenceEqual(sorted(c.events), sorted(l))
Exemple #7
0
    def test_events_eventlist(self):

        c = Calendar()
        l = EventList()
        e = Event()
        l.append(e)
        c.events = l

        self.assertEqual(c.events, [e])
Exemple #8
0
    def test_events_eventlist(self):

        c = Calendar()
        l = EventList()
        e = Event()
        l.append(e)
        c.events = l

        self.assertEqual(c.events, [e])
Exemple #9
0
 def test_eventlist_is_same(self):
     c = Calendar()
     l = EventList()
     c.events = l
     self.assertIs(c.events, l)
Exemple #10
0
    def test_events_set_string(self):

        c = Calendar(cal1)
        e = "42"
        with self.assertRaises(ValueError):
            c.events = e
Exemple #11
0
    def test_events_set_int(self):

        c = Calendar()

        with self.assertRaises(ValueError):
            c.events = 42
Exemple #12
0
 def test_eventlist_is_same(self):
     c = Calendar()
     l = EventList()
     c.events = l
     self.assertIs(c.events, l)
Exemple #13
0
    def test_events_set_string(self):

        c = Calendar(cal1)
        e = "42"
        with self.assertRaises(ValueError):
            c.events = e
Exemple #14
0
    def test_events_set_int(self):

        c = Calendar()

        with self.assertRaises(ValueError):
            c.events = 42