mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-25 00:31:55 +00:00
Now tests that loser repo is clean and survex runs on 1623.svx and 1626.svx
This commit is contained in:
parent
e9790e70d6
commit
b470ab66e2
@ -172,4 +172,32 @@ class SubprocessTest(TestCase):
|
|||||||
msg = f'{cwd} - Failed to find expected git output: "{ph1}" or "{ph2}"'
|
msg = f'{cwd} - Failed to find expected git output: "{ph1}" or "{ph2}"'
|
||||||
self.assertIsNotNone(phmatch, msg)
|
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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user