diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/TESTS/test_imports.py | 18 |
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}") |