@pytest.mark.xfail(reason='pickle does not produce same error')
@pytest.mark.parametrize('serial', all_formats)
def test_builtin_403_exception(iris_server, serial):
 t = symbol('t', discover(iris))
 for name in ('map', 'apply'):
  func = getattr(t.species, name)
  expr = func(eval, 'int')
  query = {'expr': to_tree(expr)}
  response = iris_server.post('/compute', data=serial.dumps(query), headers=mimetype(serial))
  assert ('403 FORBIDDEN'.lower() in response.status.lower())

@ pytest . mark . xfail ( reason = 'pickle does not produce same error' ) @ pytest . mark . parametrize ( 'serial' , all_formats ) def test_builtin_403_exception ( iris_server , serial ) : t = symbol ( 't' , discover ( iris ) ) for name in ( 'map' , 'apply' ) : func = getattr ( t . species , name ) expr = func ( eval , 'int' ) query = { 'expr' : to_tree ( expr ) } response = iris_server . post ( '/compute' , data = serial . dumps ( query ) , headers = mimetype ( serial ) ) assert ( '403 FORBIDDEN' . lower ( ) in response . status . lower ( ) )
ensure exception is raised when both map and apply are invoked .