コード例 #1
0
    def test_interval_deserializing(self):
        """Correct deserialization."""
        data = {'every': 7, 'period': 'days'}

        i = Interval.from_dict(data)
        self.assertEqual(i.period, 'days')
        self.assertEqual(i.every, 7)
コード例 #2
0
    def test_interval_deserializing_no_data(self):
        """No data when deserializing."""
        i = Interval.from_dict(None)

        self.assertIsNone(i)