Exemplo n.º 1
0
def test_duck_array_build():

    a = Duck()
    count = 0
    for i in range(3):
        for j in range(4):
            a[i, j] = count
            count += 1
    desired_array = np.arange(12).reshape(3, 4)
    assert a == desired_array
    assert np.array_equal(a.to_array(), desired_array)
Exemplo n.º 2
0
def test_duck_array_build():

    a = Duck()
    count = 0
    for i in range(3):
        for j in range(4):
            a[i, j] = count
            count+=1
    desired_array = np.arange(12).reshape(3, 4)
    assert a==desired_array
    assert np.array_equal(a.to_array(), desired_array)
Exemplo n.º 3
0
def test_simple_growing():
    a = Duck()
    for i in range(10):
        a[next] = i * 2
    assert np.array_equal(a.to_array(), np.arange(0, 20, 2))
Exemplo n.º 4
0
def test_simple_growing():
    a = Duck()
    for i in range(10):
        a[next] = i*2
    assert np.array_equal(a.to_array(), np.arange(0, 20, 2))