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, 25, 10, 61), 'mylib.array_add_value', 'mylib.array_add_value', ({(10, 47, 10, 53): 'in_arr', (10, 55, 10, 60): 'np.pi'}, {}), '(in_arr, np.pi)', False, 'import mylib\n'), ((9, 17, 9, 39), 'numpy.random.rand', 'np.random.rand', ({(9, 32, 9, 38): '*shape'}, {}), '(*shape)', True, 'import numpy as np\n'), ((8, 46, 8, 70), 'numpy.random.randint', 'np.random.randint', ({(8, 64, 8, 65): '3', (8, 67, 8, 69): '10'}, {}), '(3, 10)', True, 'import numpy as np\n')]