Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
def opt_engine_rest_api():
    """Perform OptimEngine optimization after validating the request
    """
    request_json = request.get_json()
    return process_request(request_json)
Exemple #4
0
    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