예제 #1
0
def test_canonicalize_integer_intervals():
    assert str(canonicalize(IntInterval([1, 4]))) == '[1, 5)'
    assert str(canonicalize(
        IntInterval((1, 7)), lower_inc=True, upper_inc=True
    )) == '[2, 6]'
    assert str(canonicalize(
        IntInterval([1, 7]), lower_inc=False, upper_inc=True
    )) == '(0, 7]'
예제 #2
0
def test_canonicalize_integer_intervals():
    assert str(canonicalize(IntInterval([1, 4]))) == '[1, 5)'
    assert str(
        canonicalize(IntInterval((1, 7)), lower_inc=True,
                     upper_inc=True)) == '[2, 6]'
    assert str(
        canonicalize(IntInterval([1, 7]), lower_inc=False,
                     upper_inc=True)) == '(0, 7]'
예제 #3
0
 def canonicalize_result_value(self, value):
     return intervals.canonicalize(value, True, True)
예제 #4
0
def test_canonicalize_date_intervals():
    interval = canonicalize(DateInterval([date(2000, 2, 2), date(2000, 2, 6)]))
    assert interval.upper.day == 7
예제 #5
0
 def canonicalize_result_value(self, value):
     return intervals.canonicalize(value, True, True)
예제 #6
0
def test_canonicalize_date_intervals():
    interval = canonicalize(DateInterval([date(2000, 2, 2), date(2000, 2, 6)]))
    assert interval.upper.day == 7