def test_numpy_deser_from_json_alpha():
    arr = NumpyDeserializer(dtype='U5')(io.BytesIO(b'[["hello",2,3],\n[4,5,6]]'), 'application/json')
    assert np.array_equal(arr, np.array([['hello', 2, 3], [4, 5, 6]]))
def test_numpy_deser_from_json_ragged():
    arr = NumpyDeserializer()(io.BytesIO(b'[[1,2,3],\n[4,5,6,7]]'), 'application/json')
    assert np.array_equal(arr, np.array([[1, 2, 3], [4, 5, 6, 7]]))
def test_numpy_deser_from_csv_ragged():
    with pytest.raises(ValueError) as error:
        NumpyDeserializer()(io.BytesIO(b'1,2,3\n4,5,6,7'), 'text/csv')
    assert "errors were detected" in str(error)
def test_numpy_deser_from_csv_alpha():
    arr = NumpyDeserializer(dtype='U5')(io.BytesIO(b'hello,2,3\n4,5,6'), 'text/csv')
    assert np.array_equal(arr, np.array([['hello', 2, 3], [4, 5, 6]]))
def test_numpy_deser_from_csv():
    arr = NumpyDeserializer()(io.BytesIO(b'1,2,3\n4,5,6'), 'text/csv')
    assert np.array_equal(arr, np.array([[1, 2, 3], [4, 5, 6]]))