Пример #1
0
def test_new_matrix():
    data = [
        [1.0, 2.0, 3.0],
        [4.0, 5.0, 6.0],
    ]
    m = Matrix(data)
    assert m.get_data() == data

    with pytest.raises(ValueError):
        Matrix([
            [1.0, 2.0, 3.0],
            [4.0, 5.0],
        ])

    with pytest.raises(ValueError):
        Matrix([])

    with pytest.raises(ValueError):
        Matrix([
            [],
            []
        ])