def test_build_repeating_interval(self): testtuples = (({}, (None, None, None, 'repeatinginterval')), ({'R': True, 'interval': (('1', '2', '3', '4', '5', '6', 'date'), ('7', '8', '9', '10', '11', '12', 'date'), None, 'interval')}, (True, None, (('1', '2', '3', '4', '5', '6', 'date'), ('7', '8', '9', '10', '11', '12', 'date'), None, 'interval'), 'repeatinginterval')), ({'R': False, 'Rnn': '1', 'interval': ((('2', '3', '4', '5', '6', '7', 'date'), ('8', '9', '10', None, 'time'), 'datetime'), (('11', '12', '13', '14', '15', '16', 'date'), ('17', '18', '19', None, 'time'), 'datetime'), None, 'interval')}, (False, '1', ((('2', '3', '4', '5', '6', '7', 'date'), ('8', '9', '10', None, 'time'), 'datetime'), (('11', '12', '13', '14', '15', '16', 'date'), ('17', '18', '19', None, 'time'), 'datetime'), None, 'interval'), 'repeatinginterval'))) for testtuple in testtuples: result = TupleBuilder.build_repeating_interval(**testtuple[0]) self.assertEqual(result, testtuple[1])
def test_build_repeating_interval(self): testtuples = (({}, RepeatingIntervalTuple( None, None, None)), ({ 'R': True, 'interval': IntervalTuple(DateTuple('1', '2', '3', '4', '5', '6'), DateTuple('7', '8', '9', '10', '11', '12'), None) }, RepeatingIntervalTuple( True, None, IntervalTuple( DateTuple('1', '2', '3', '4', '5', '6'), DateTuple('7', '8', '9', '10', '11', '12'), None))), ({ 'R': False, 'Rnn': '1', 'interval': IntervalTuple( DatetimeTuple( DateTuple('2', '3', '4', '5', '6', '7'), TimeTuple('8', '9', '10', None)), DatetimeTuple( DateTuple('11', '12', '13', '14', '15', '16'), TimeTuple('17', '18', '19', None)), None) }, RepeatingIntervalTuple( False, '1', IntervalTuple( DatetimeTuple( DateTuple('2', '3', '4', '5', '6', '7'), TimeTuple('8', '9', '10', None)), DatetimeTuple( DateTuple('11', '12', '13', '14', '15', '16'), TimeTuple('17', '18', '19', None)), None)))) for testtuple in testtuples: result = TupleBuilder.build_repeating_interval(**testtuple[0]) self.assertEqual(result, testtuple[1])
def test_build_repeating_interval(self): testtuples = ( ({}, (None, None, None, "repeatinginterval")), ( { "R": True, "interval": ( ("1", "2", "3", "4", "5", "6", "date"), ("7", "8", "9", "10", "11", "12", "date"), None, "interval", ), }, ( True, None, ( ("1", "2", "3", "4", "5", "6", "date"), ("7", "8", "9", "10", "11", "12", "date"), None, "interval", ), "repeatinginterval", ), ), ( { "R": False, "Rnn": "1", "interval": ( ( ("2", "3", "4", "5", "6", "7", "date"), ("8", "9", "10", None, "time"), "datetime", ), ( ("11", "12", "13", "14", "15", "16", "date"), ("17", "18", "19", None, "time"), "datetime", ), None, "interval", ), }, ( False, "1", ( ( ("2", "3", "4", "5", "6", "7", "date"), ("8", "9", "10", None, "time"), "datetime", ), ( ("11", "12", "13", "14", "15", "16", "date"), ("17", "18", "19", None, "time"), "datetime", ), None, "interval", ), "repeatinginterval", ), ), ) for testtuple in testtuples: result = TupleBuilder.build_repeating_interval(**testtuple[0]) self.assertEqual(result, testtuple[1])
def test_build_repeating_interval(self): testtuples = ( ({}, RepeatingIntervalTuple(None, None, None)), ( { "R": True, "interval": IntervalTuple( DateTuple("1", "2", "3", "4", "5", "6"), DateTuple("7", "8", "9", "10", "11", "12"), None, ), }, RepeatingIntervalTuple( True, None, IntervalTuple( DateTuple("1", "2", "3", "4", "5", "6"), DateTuple("7", "8", "9", "10", "11", "12"), None, ), ), ), ( { "R": False, "Rnn": "1", "interval": IntervalTuple( DatetimeTuple( DateTuple("2", "3", "4", "5", "6", "7"), TimeTuple("8", "9", "10", None), ), DatetimeTuple( DateTuple("11", "12", "13", "14", "15", "16"), TimeTuple("17", "18", "19", None), ), None, ), }, RepeatingIntervalTuple( False, "1", IntervalTuple( DatetimeTuple( DateTuple("2", "3", "4", "5", "6", "7"), TimeTuple("8", "9", "10", None), ), DatetimeTuple( DateTuple("11", "12", "13", "14", "15", "16"), TimeTuple("17", "18", "19", None), ), None, ), ), ), ) for testtuple in testtuples: result = TupleBuilder.build_repeating_interval(**testtuple[0]) self.assertEqual(result, testtuple[1])