def test_random(): length = 5 assert Vector.random(length, 0, 10, Zeroes()) == Vector.zeroes(length) assert Vector.random(length, 0, 10, Ones()) == Vector([1] * length) assert Vector.random(length, 0, 10, Count()) == Vector([1, 2, 3, 4, 5])
def test_zeroes(): zeroes = Vector.zeroes(10) assert zeroes.values == tuple([0] * 10)
def test_zeroes_bad_shape(): Vector.zeroes([[11, 2], 3])