def test_invalid_solver(self): req_json = json.loads( open("./test/optengine-tests/test_optengine_invalid_solver.json"). read()) with pytest.raises(BusinessException): process_request(req_json)
def test_process_solverid_request(self, mocker): req_json = json.loads( open("./test/optengine-tests/test_optengine_modelId.json").read()) data = 200, ('junk', '', '', 'py') mocker.return_value = data process_request(req_json)
def opt_engine_rest_api(): """Perform OptimEngine optimization after validating the request """ request_json = request.get_json() return process_request(request_json)
def test_py_process_request(self): req_json = json.loads( open("./test/optengine-tests/test_py_optengine_valid.json").read()) res = process_request(req_json) assert res.status_code == 200