summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/TESTS/test_imports.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/TESTS/test_imports.py b/core/TESTS/test_imports.py
index 48e324e..b4838f6 100644
--- a/core/TESTS/test_imports.py
+++ b/core/TESTS/test_imports.py
@@ -172,4 +172,32 @@ class SubprocessTest(TestCase):
msg = f'{cwd} - Failed to find expected git output: "{ph1}" or "{ph2}"'
self.assertIsNotNone(phmatch, msg)
+ def test_loser_survex_status(self):
+ ''' Expects no failures of survex files
+ '''
+ from pathlib import Path
+ import troggle.settings as settings
+ cwd = settings.SURVEX_DATA
+ for survey in ["1623.svx", "1626.svx"]:
+ sp = subprocess.run([settings.CAVERN, survey], cwd=cwd, capture_output=True, text=True)
+ print(f'survex output: {cwd}:\n # {sp.stderr=}\n # {sp.stdout=} \n # return code: {str(sp.returncode)}')
+ if sp.returncode != 0:
+ print(f'survex output: {cwd}:\n # {sp.stderr=}\n # {sp.stdout=} \n # return code: {str(sp.returncode)}')
+
+ self.assertTrue( sp.returncode == 0, f'{cwd} - survex is unhappy')
+ content = sp.stdout
+ ph = r'Total length of survey legs'
+ phmatch = re.search(ph, content)
+ msg = f'{cwd} - Failed to find expected survex output: "{ph}"'
+ self.assertIsNotNone(phmatch, msg)
+
+ ph1 = r'Time used'
+ phmatch1 = re.search(ph1, content)
+ ph2 = r'vertical length of survey le'
+ phmatch2 = re.search(ph2, content)
+
+ phmatch = phmatch1 or phmatch2
+ msg = f'{cwd} - Failed to find expected survex output: "{ph1}" or "{ph2}"'
+ self.assertIsNotNone(phmatch, msg)
+