summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-03-05 18:02:01 +0000
committerPhilip Sargent <philip.sargent@klebos.com>2022-03-05 18:02:01 +0000
commit88f5df0f19a1b9d16e0b92dcd910f6bd7db9e2b9 (patch)
tree5c42b48b01ab4ad3b1d280c309b1384309b550d2 /core
parent5fe436e76a8b569b7ce8937b24be69b7b4261cfc (diff)
downloadtroggle-88f5df0f19a1b9d16e0b92dcd910f6bd7db9e2b9.tar.gz
troggle-88f5df0f19a1b9d16e0b92dcd910f6bd7db9e2b9.tar.bz2
troggle-88f5df0f19a1b9d16e0b92dcd910f6bd7db9e2b9.zip
More detailed debug output
Diffstat (limited to 'core')
-rw-r--r--core/TESTS/test_imports.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/core/TESTS/test_imports.py b/core/TESTS/test_imports.py
index d8bbe42..1416556 100644
--- a/core/TESTS/test_imports.py
+++ b/core/TESTS/test_imports.py
@@ -121,7 +121,7 @@ class SubprocessTest(TestCase):
pass
def test_installs(self):
- '''Expects external software installed: cavern, survexport, git
+ ''' Expects external software installed: cavern, survexport, git
(but not whether it actually works)
'''
import troggle.settings as settings
@@ -135,28 +135,30 @@ class SubprocessTest(TestCase):
self.assertTrue( False, f'no {i} installed')
def test_repos_git_status(self):
- '''Expects a clean git repo with no added files and no merge failures
+ ''' Expects clean git repos with no added files and no merge failures
'''
from pathlib import Path
import troggle.settings as settings
- for cwd in [settings.EXPOWEB, settings.DRAWINGS_DATA, Path(settings.REPOS_ROOT_PATH) / "troggle"]: # add settings.SURVEX_DATA when loser is gitified
+ TROGGLE_PATH = Path(settings.REPOS_ROOT_PATH) / "troggle"
+ for cwd in [settings.EXPOWEB, settings.DRAWINGS_DATA, TROGGLE_PATH]: # add settings.SURVEX_DATA when loser is gitified
sp = subprocess.run([settings.GIT, "status"], cwd=cwd, capture_output=True, text=True)
- print(str(cwd) + ":\n\n" + sp.stderr + '\n\n' + sp.stdout + '\n\nreturn code: ' + str(sp.returncode))
+ scwd = str(cwd)
+ #print(scwd + ":\n\n" + sp.stderr + '\n\n' + sp.stdout + '\n\nreturn code: ' + str(sp.returncode))
if sp.returncode != 0:
- print(str(cwd) + ":\n\n" + sp.stderr + '\n\n' + sp.stdout + '\n\nreturn code: ' + str(sp.returncode))
- self.assertTrue( sp.returncode == 0, f'{cwd} - git is unhappy')
+ 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')
content = sp.stdout
ph = r'Your branch is up to date'
phmatch = re.search(ph, content)
- self.assertIsNotNone(phmatch, f"{cwd} - Failed to find expected git output: '" + ph +"'")
+ self.assertIsNotNone(phmatch, f"{scwd} - Failed to find expected git output: '" + ph +"'")
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"{cwd} - Failed to find expected git output: {ph1} or {ph2}")
+ self.assertIsNotNone(phmatch, f"{scwd} - Failed to find expected git output: {ph1} or {ph2}")