summaryrefslogtreecommitdiffstats
path: root/core/TESTS
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-09-12 22:47:31 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-09-12 22:47:31 +0300
commit29dc99c21faefb1530b19abbd2a090fb07a169b1 (patch)
treed37667dd1444d934e722580ea05cbc874a50f1ca /core/TESTS
parentdfc903208ebc374f9b711665a05600336a2ff701 (diff)
downloadtroggle-29dc99c21faefb1530b19abbd2a090fb07a169b1.tar.gz
troggle-29dc99c21faefb1530b19abbd2a090fb07a169b1.tar.bz2
troggle-29dc99c21faefb1530b19abbd2a090fb07a169b1.zip
tidy bad git messages in tests
Diffstat (limited to 'core/TESTS')
-rw-r--r--core/TESTS/test_imports.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/TESTS/test_imports.py b/core/TESTS/test_imports.py
index 52b1fd4..48e324e 100644
--- a/core/TESTS/test_imports.py
+++ b/core/TESTS/test_imports.py
@@ -152,22 +152,24 @@ class SubprocessTest(TestCase):
TROGGLE_PATH = Path(settings.REPOS_ROOT_PATH) / "troggle"
for cwd in [settings.SURVEX_DATA, settings.EXPOWEB, settings.DRAWINGS_DATA, TROGGLE_PATH]:
sp = subprocess.run([settings.GIT, "status"], cwd=cwd, capture_output=True, text=True)
- scwd = str(cwd)
- # print(scwd + ":\n\n#" + sp.stderr + '\n\n#' + sp.stdout + '\n\n# return code: ' + str(sp.returncode))
+ print(f'git output: {cwd}:\n # {sp.stderr=}\n # {sp.stdout=} \n # return code: {str(sp.returncode)}')
if sp.returncode != 0:
- print(scwd + ":\n\n" + sp.stderr + '\n\n' + sp.stdout + '\n\nreturn code: ' + str(sp.returncode))
- self.assertTrue( sp.returncode == 0, f'{scwd} - git is unhappy')
+ print(f'git output: {cwd}:\n # {sp.stderr=}\n # {sp.stdout=} \n # return code: {str(sp.returncode)}')
+
+ self.assertTrue( sp.returncode == 0, f'{cwd} - git is unhappy')
content = sp.stdout
ph = r'Your branch is up[ -]to[ -]date'
phmatch = re.search(ph, content)
- self.assertIsNotNone(phmatch, f"{scwd} - Failed to find expected git output: '" + ph +"'")
+ msg = f'{cwd} - Failed to find expected git output: "{ph}"'
+ self.assertIsNotNone(phmatch, msg)
ph1 = r'no changes added to commit'
phmatch1 = re.search(ph1, content)
ph2 = r'nothing to commit'
phmatch2 = re.search(ph2, content)
phmatch = phmatch1 or phmatch2
- self.assertIsNotNone(phmatch, f"{scwd} - 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)