Beispiel #1
0
    def test_interval_correct_every_init(self):
        """Using getter with correct data set."""
        i = Interval()

        i.every = '7'
        self.assertEqual(i.every, 7)

        i.every = 7
        self.assertEqual(i.every, 7)
Beispiel #2
0
    def test_interval_has_schedule(self):
        """Interval schedule property is valid."""
        i = Interval()
        i.period = 'days'
        i.every = 7

        self.assertIsInstance(i.schedule, celery.schedules.schedule)
Beispiel #3
0
    def test_interval_serializing(self):
        """Correct serialization."""
        i = Interval()
        i.period = 'days'
        i.every = 7

        self.assertEqual(i.to_dict(), {'every': 7, 'period': 'days'})
Beispiel #4
0
    def test_interval_set_every_no_data(self):
        """Every is set to zero."""
        i = Interval()

        i.every = None
        self.assertEqual(i.every, 0)