Beispiel #1
0
def test_ellipsis_expansion():
    slicing = (slice(2), Ellipsis, 2)
    fixed = _expand_ellipsis(slicing, 4)
    should_be = (slice(2), slice(None), slice(None), 2)
    yield nt.assert_true, fixed == should_be, 'wrong slicer1'
    fixed = _expand_ellipsis(slicing, 2)
    should_be = (slice(2), 2)
    yield nt.assert_true, fixed == should_be, 'wrong slicer2'
Beispiel #2
0
def test_ellipsis_expansion():
    slicing = ( slice(2), Ellipsis, 2 )
    fixed = _expand_ellipsis(slicing, 4)
    should_be = ( slice(2), slice(None), slice(None), 2 )
    yield nt.assert_true, fixed==should_be, 'wrong slicer1'
    fixed = _expand_ellipsis(slicing, 2)
    should_be = ( slice(2), 2 )
    yield nt.assert_true, fixed==should_be, 'wrong slicer2'
Beispiel #3
0
def test_ellipsis_expansion():
    slicing = (slice(2), Ellipsis, 2)
    fixed = _expand_ellipsis(slicing, 4)
    should_be = (slice(2), slice(None), slice(None), 2)
    nt.assert_true(fixed == should_be, "wrong slicer1")
    fixed = _expand_ellipsis(slicing, 2)
    should_be = (slice(2), 2)
    nt.assert_true(fixed == should_be, "wrong slicer2")