Blob Blame History Raw
From b338dee563932c44bed50b54a1ce00c8e83c0465 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Wed, 23 Oct 2019 11:13:55 -0400
Subject: [PATCH 5/8] Add test_data_path env var for Python tests

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
---
 modulemd/v2/meson.build                 | 1 +
 modulemd/v2/tests/ModulemdTests/base.py | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/modulemd/v2/meson.build b/modulemd/v2/meson.build
index e8a5a38f0528c4f860f0b84ef63609ff5fd89caa..5137b7d23ec66e39a56cf022974da6570c8e4822 100644
--- a/modulemd/v2/meson.build
+++ b/modulemd/v2/meson.build
@@ -93,6 +93,7 @@ install_headers(
 test_release_env = environment()
 test_release_env.set('LC_ALL', 'C')
 test_release_env.set ('MESON_SOURCE_ROOT', meson.source_root())
+test_release_env.set ('TEST_DATA_PATH', meson.source_root() + '/modulemd/tests/test_data')
 
 # Test env with fatal warnings and criticals
 test_env = test_release_env
diff --git a/modulemd/v2/tests/ModulemdTests/base.py b/modulemd/v2/tests/ModulemdTests/base.py
index 831309634100f25533c9a7dafe7f96bf7e100cd7..5f396958fd7a20e6567cfe69f99eaeb95825663a 100644
--- a/modulemd/v2/tests/ModulemdTests/base.py
+++ b/modulemd/v2/tests/ModulemdTests/base.py
@@ -28,6 +28,10 @@ class TestBase(unittest.TestCase):
     def source_root(self):
         return os.getenv("MESON_SOURCE_ROOT")
 
+    @property
+    def test_data_path(self):
+        return os.getenv("TEST_DATA_PATH")
+
     def _catch_signal(self, *sigargs):
         if self._caught_signal:
             raise AssertionError("Multiple signals were caught")
-- 
2.23.0