예제 #1
0
def testTwoRange():
    s = '0-2,10-12'
    assert_equal([0,1,2,10,11,12], list(multirange(s)))
예제 #2
0
def testStr():
    s = '0-2,20-25,30-31'
    assert_equal(s, str(multirange(s)))
예제 #3
0
def testSingleRange():
    assert_equal([0,1,2,3,4], list(multirange('0-4')))
예제 #4
0
def testFloatParse():
    s = '0-0.5'
    conv = lambda x: time_to_frame(float(x))
    assert_equal(range(0,15), list(multirange(s, parser=conv)))
예제 #5
0
def testIndexing():
    s = '0-10'
    x = multirange(s)
    x[0]
예제 #6
0
def testErrorOverlappingRanges():
    s = '0-10,5-15'
    multirange(s)
예제 #7
0
def testCloseOverlap():
    multirange('0-10,10-12')
예제 #8
0
def testSingleRange():
    assert_equal([0, 1, 2, 3, 4], list(multirange('0-4')))
예제 #9
0
def testThreeRange():
    s = '0-2,20-25,30-31'
    assert_equal([0,1,2,20,21,22,23,24,25,30,31], list(multirange(s)))
예제 #10
0
def testIndexing():
    s = '0-10'
    x = multirange(s)
    x[0]
예제 #11
0
def testStr():
    s = '0-2,20-25,30-31'
    assert_equal(s, str(multirange(s)))
예제 #12
0
def testFloatParse():
    s = '0-0.5'
    conv = lambda x: time_to_frame(float(x))
    assert_equal(range(0, 15), list(multirange(s, parser=conv)))
예제 #13
0
def testCloseOverlap():
    multirange('0-10,10-12')
예제 #14
0
def testErrorOverlappingRanges():
    s = '0-10,5-15'
    multirange(s)
예제 #15
0
def testThreeRange():
    s = '0-2,20-25,30-31'
    assert_equal([0, 1, 2, 20, 21, 22, 23, 24, 25, 30, 31],
                 list(multirange(s)))
예제 #16
0
def testTwoRange():
    s = '0-2,10-12'
    assert_equal([0, 1, 2, 10, 11, 12], list(multirange(s)))