Beispiel #1
0
def test_clear():
    'test clear()'
    oc = OrderedCollection(range(4))
    oc.clear()

    assert len(oc) == 0
    assert oc._elems == []  # there should be no None's
    assert oc._d_index == {}
    assert oc.dtype is int
    with raises(TypeError):
        oc += 1.0
def test_clear():
    'test clear()'
    oc = OrderedCollection(range(4))
    oc.clear()

    assert len(oc) == 0
    assert oc._elems == []   # there should be no None's
    assert oc._d_index == {}
    assert oc.dtype is int
    with raises(TypeError):
        oc += 1.0