def METHOD_NAME(self):
    const = 3
    @njit
    def foo(array):
        a = to_fixed_tuple(array, length=1)
        b = to_fixed_tuple(array, 2)
        c = to_fixed_tuple(array, const)
        d = to_fixed_tuple(array, 0)
        return a, b, c, d
    np.random.seed(123)
    for _ in range(10):
        # Random data
        arr = np.random.random(3)
        # Run
        a, b, c, d = foo(arr)
        # Check
        self.assertEqual(a, tuple(arr[:1]))
        self.assertEqual(b, tuple(arr[:2]))
        self.assertEqual(c, tuple(arr[:3]))
        self.assertEqual(d, ())
    # Check error with ndim!=1
    with self.assertRaises(TypingError) as raises:
        foo(np.random.random((1, 2)))
    self.assertIn("Not supported on array.ndim=2",
                  str(raises.exception))
    # Check error with non-constant length
    @njit
    def tuple_with_length(array, length):
        return to_fixed_tuple(array, length)
    with self.assertRaises(TypingError) as raises:
        tuple_with_length(np.random.random(3), 1)
    expectmsg = "*length* argument must be a constant"
    self.assertIn(expectmsg, str(raises.exception))