Skip to content

Commit 67462ff

Browse files
author
Axel Hörteborn
committed
another update to the conftest
1 parent a90512c commit 67462ff

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88
if _project_root not in sys.path:
99
sys.path.insert(0, _project_root)
1010

11+
# Create meta_data XML files from templates if they don't exist
12+
# This ensures tests can run in CI where the actual XML files are gitignored
13+
import shutil
14+
import glob
15+
_meta_data_dir = os.path.join(_project_root, 'support_scripts', 'pyagriculture', 'meta_data')
16+
if os.path.isdir(_meta_data_dir):
17+
for template_path in glob.glob(os.path.join(_meta_data_dir, '*.xml.template')):
18+
xml_path = template_path.replace('.template', '')
19+
if not os.path.exists(xml_path):
20+
shutil.copy(template_path, xml_path)
21+
1122
# Create a 'geodatafarm' module that points to the project root
1223
# This enables imports like 'from geodatafarm.support_scripts.xxx import yyy'
1324
if 'geodatafarm' not in sys.modules:

0 commit comments

Comments
 (0)