import numpy as np

import mylib


def test_arr_add_value():
    for _ in range(10):
        shape = np.random.randint(1, 10, size=np.random.randint(3, 10)).tolist()
        in_arr = np.random.rand(*shape).astype(np.double)
        ok = np.allclose(mylib.array_add_value(in_arr, np.pi), in_arr + np.pi)
        if not ok:
            raise ValueError("incorrect result")

[(10, 'mylib.array_add_value', 'mylib.array_add_value', False, 'import mylib\n'), (9, 'numpy.random.rand', 'np.random.rand', True, 'import numpy as np\n'), (8, 'numpy.random.randint', 'np.random.randint', True, 'import numpy as np\n')]