From 8283d1ac8663b1e8975bf873e51745a26c19406a Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Tue, 11 Jun 2019 09:53:21 +0200 Subject: [PATCH] Python: test for opening project --- ApplicationCode/GrpcInterface/CMakeLists.cmake | 1 + .../GrpcInterface/Python/tests/test_project.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 ApplicationCode/GrpcInterface/Python/tests/test_project.py diff --git a/ApplicationCode/GrpcInterface/CMakeLists.cmake b/ApplicationCode/GrpcInterface/CMakeLists.cmake index 1e810b7009..b3337d5973 100644 --- a/ApplicationCode/GrpcInterface/CMakeLists.cmake +++ b/ApplicationCode/GrpcInterface/CMakeLists.cmake @@ -172,6 +172,7 @@ if (PYTHON_EXECUTABLE AND EXISTS ${PYTHON_EXECUTABLE}) "tests/test_commands.py" "tests/test_grids.py" "tests/test_properties.py" + "tests/test_project.py" "tests/conftest.py" "tests/dataroot.py" "requirements.txt" diff --git a/ApplicationCode/GrpcInterface/Python/tests/test_project.py b/ApplicationCode/GrpcInterface/Python/tests/test_project.py new file mode 100644 index 0000000000..3786b918ff --- /dev/null +++ b/ApplicationCode/GrpcInterface/Python/tests/test_project.py @@ -0,0 +1,17 @@ +import sys +import os +import pytest + +sys.path.insert(1, os.path.join(sys.path[0], '..')) +import rips + +import dataroot + +def test_loadProject(rips_instance, initializeTest): + project = rips_instance.project.open(dataroot.PATH + "/TEST10K_FLT_LGR_NNC/10KWithWellLog.rsp") + case = project.case(id=0) + assert(case is not None) + assert(case.name == "TEST10K_FLT_LGR_NNC") + assert(case.id == 0) + cases = rips_instance.project.cases() + assert(len(cases) is 1) \ No newline at end of file