summaryrefslogtreecommitdiffstats
path: root/core/TESTS
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-10-08 20:43:01 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-10-08 20:43:01 +0300
commitb470ab66e2db18bbad4c9190635a2d8e0ae8eb81 (patch)
tree1622d820cbe4241da2983d141928e428eb335831 /core/TESTS
parente9790e70d64c3e63336aac53eee0fcd22b30f407 (diff)
downloadtroggle-b470ab66e2db18bbad4c9190635a2d8e0ae8eb81.tar.gz
troggle-b470ab66e2db18bbad4c9190635a2d8e0ae8eb81.tar.bz2
troggle-b470ab66e2db18bbad4c9190635a2d8e0ae8eb81.zip
Now tests that loser repo is clean and survex runs on 1623.svx and 1626.svx
Diffstat (limited to 'core/TESTS')
-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)
+