From 4b4a5096a6f27cd03b888216715b5c7efd576e89 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Wed, 30 Sep 2020 13:18:42 +0200
Subject: [PATCH] [T] Adapt HeatTransportBHE_3D_3BHEs_array to new python
 environment.

---
 ProcessLib/HeatTransportBHE/Tests.cmake                |  3 ++-
 Tests/Data/Parabolic/T/3D_3BHEs_array/README.md        | 10 ++--------
 Tests/Data/Parabolic/T/3D_3BHEs_array/bcs_tespy.py     |  3 +--
 Tests/Data/Parabolic/T/3D_3BHEs_array/requirements.txt |  1 -
 4 files changed, 5 insertions(+), 12 deletions(-)
 delete mode 100644 Tests/Data/Parabolic/T/3D_3BHEs_array/requirements.txt

diff --git a/ProcessLib/HeatTransportBHE/Tests.cmake b/ProcessLib/HeatTransportBHE/Tests.cmake
index 906eddd362d..1f97f770e7c 100644
--- a/ProcessLib/HeatTransportBHE/Tests.cmake
+++ b/ProcessLib/HeatTransportBHE/Tests.cmake
@@ -89,9 +89,10 @@ AddTest(
     RUNTIME 50
     EXECUTABLE ogs
     EXECUTABLE_ARGS 3bhes_1U.prj
-    WRAPPER time
+    WRAPPER poetry # required for PYTHON_PACKAGES
     TESTER vtkdiff
     REQUIREMENTS OGS_USE_PYTHON AND NOT OGS_USE_MPI
+    PYTHON_PACKAGES TESPy=0.3.2
     DIFF_DATA
     3bhes_1U_pcs_0_ts_10_t_600.000000.vtu 3bhes_1U_pcs_0_ts_10_t_600.000000.vtu temperature_soil temperature_soil 1e-12 1e-13
     3bhes_1U_pcs_0_ts_10_t_600.000000.vtu 3bhes_1U_pcs_0_ts_10_t_600.000000.vtu temperature_BHE1 temperature_BHE1 1e-10 1e-13
diff --git a/Tests/Data/Parabolic/T/3D_3BHEs_array/README.md b/Tests/Data/Parabolic/T/3D_3BHEs_array/README.md
index 56c4278f3e7..92f79b19686 100644
--- a/Tests/Data/Parabolic/T/3D_3BHEs_array/README.md
+++ b/Tests/Data/Parabolic/T/3D_3BHEs_array/README.md
@@ -1,11 +1,5 @@
 # How to run
 
- You need to build OGS with `OGS_USE_PYTHON=ON` and have the Python modules
- listed in `requirements.txt` installed, e.g.:
+ You need to have [poetry][1] installed and build OGS with `OGS_USE_PYTHON=ON`.
 
- - In this directory:
-   - `virtualenv .venv` Make sure you use the same Python interpreter which was
-     embedded into OGS (look for `Found PythonInterp: ..` in the CMake output)
-   - `source .venv/bin/activate`
-   - `pip install -r requirements.txt`
-   - `PYTHONPATH=.venv/lib/python3.7/site-packages ~/code/ogs6/build/bin/ogs -o ~/tmp 3bhes_1U.prj`
+ [1]: https://python-poetry.org
diff --git a/Tests/Data/Parabolic/T/3D_3BHEs_array/bcs_tespy.py b/Tests/Data/Parabolic/T/3D_3BHEs_array/bcs_tespy.py
index df8fe460606..9451cf8fc35 100644
--- a/Tests/Data/Parabolic/T/3D_3BHEs_array/bcs_tespy.py
+++ b/Tests/Data/Parabolic/T/3D_3BHEs_array/bcs_tespy.py
@@ -155,8 +155,7 @@ class BC(OpenGeoSys.BHENetwork):
 # initialize the tespy model of the bhe network
 # load path of network model:
 # loading the TESPy model
-project_dir = os.getcwd()
-print("Project dir is: ", project_dir)
+project_dir = os.chdir(ogs_prj_directory)
 nw = load_network('./pre/tespy_nw')
 # set if print the network iteration info
 nw.set_attr(iterinfo=False)
diff --git a/Tests/Data/Parabolic/T/3D_3BHEs_array/requirements.txt b/Tests/Data/Parabolic/T/3D_3BHEs_array/requirements.txt
deleted file mode 100644
index a786bbd3757..00000000000
--- a/Tests/Data/Parabolic/T/3D_3BHEs_array/requirements.txt
+++ /dev/null
@@ -1 +0,0 @@
-TESPy==0.3.2
-- 
GitLab