Пример #1
0
def test_asn2array_fail():
    """
    check if it fails when wrong imput is used
    """
    with pytest.raises(ValueError):
        arr = py_gd.asn2array([(1, 2, 3), (3, 4, 5), (5, 6, 7)], dtype=np.intc)

    with pytest.raises(ValueError):
        arr = py_gd.asn2array((1, 2, 3, 3, 4, 5, 5, 6, 7), dtype=np.intc)

    assert True
Пример #2
0
def test_asn2array_fail():
    """
    check if it fails when wrong imput is used
    """
    with pytest.raises(ValueError):
        arr = py_gd.asn2array([(1, 2, 3), (3, 4, 5), (5, 6, 7)], dtype=np.intc)

    with pytest.raises(ValueError):
        arr = py_gd.asn2array((1, 2, 3, 3, 4, 5, 5, 6, 7), dtype=np.intc)

    assert True
Пример #3
0
def test_asn2array():
    """
    check if it works when the right input is used
    """
    arr = py_gd.asn2array([(1, 2), (3, 4), (5, 6)], dtype=np.intc)

    assert type(arr) == np.ndarray
    assert arr.shape == (3, 2)
    assert arr.dtype == np.intc
Пример #4
0
def test_asn2array():
    """
    check if it works when the right input is used
    """
    arr = py_gd.asn2array([(1, 2), (3, 4), (5, 6)], dtype=np.intc)

    assert type(arr) == np.ndarray
    assert arr.shape == (3, 2)
    assert arr.dtype == np.intc