From dad61cd2fe958fef926423c3f5fcef87ce034a6d Mon Sep 17 00:00:00 2001
From: Christoph Lehmann <christoph.lehmann@ufz.de>
Date: Fri, 7 Oct 2022 09:18:15 +0200
Subject: [PATCH] [T] Added Python BC pytest

---
 Tests/Python/test_python_bc_simulation.py | 31 +++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 Tests/Python/test_python_bc_simulation.py

diff --git a/Tests/Python/test_python_bc_simulation.py b/Tests/Python/test_python_bc_simulation.py
new file mode 100644
index 00000000000..1b772315356
--- /dev/null
+++ b/Tests/Python/test_python_bc_simulation.py
@@ -0,0 +1,31 @@
+import tempfile
+import os
+
+import pytest
+import ogs.simulator as sim
+
+
+def test_HM_ground_equil_TaylorHood_Python():
+    srcdir = os.path.join(os.path.dirname(__file__), "..", "..")
+    prjpath = os.path.join(
+        srcdir,
+        "Tests/Data/HydroMechanics/GroundEquilibrium/simHM_ground_quadBCu_python.prj",
+    )
+
+    with tempfile.TemporaryDirectory() as tmpdirname:
+        arguments = ["ogs", prjpath, "-o", tmpdirname]
+
+        try:
+            print("Python OpenGeoSys.init ...")
+            assert 0 == sim.initialize(arguments)
+            print("Python OpenGeoSys.executeSimulation ...")
+            assert 0 == sim.executeSimulation()
+        finally:
+            print("Python OpenGeoSys.finalize() ...")
+            sim.finalize()
+
+        assert os.path.exists(
+            os.path.join(
+                tmpdirname, "simHM_ground_quadBCu_python_ts_10_t_1000000.000000.vtu"
+            )
+        )
-- 
GitLab