mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-17 13:17:11 +00:00
test for loser git repo sanity
This commit is contained in:
@@ -150,10 +150,10 @@ class SubprocessTest(TestCase):
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import troggle.settings as settings
|
import troggle.settings as settings
|
||||||
TROGGLE_PATH = Path(settings.REPOS_ROOT_PATH) / "troggle"
|
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
|
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)
|
sp = subprocess.run([settings.GIT, "status"], cwd=cwd, capture_output=True, text=True)
|
||||||
scwd = str(cwd)
|
scwd = str(cwd)
|
||||||
#print(scwd + ":\n\n" + sp.stderr + '\n\n' + sp.stdout + '\n\nreturn code: ' + str(sp.returncode))
|
# print(scwd + ":\n\n#" + sp.stderr + '\n\n#' + sp.stdout + '\n\n# return code: ' + str(sp.returncode))
|
||||||
if sp.returncode != 0:
|
if sp.returncode != 0:
|
||||||
print(scwd + ":\n\n" + sp.stderr + '\n\n' + sp.stdout + '\n\nreturn code: ' + str(sp.returncode))
|
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')
|
self.assertTrue( sp.returncode == 0, f'{scwd} - git is unhappy')
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ class PostTests(TestCase):
|
|||||||
|
|
||||||
def test_dwg_upload_drawing(self):
|
def test_dwg_upload_drawing(self):
|
||||||
'''Expect no-suffix file to upload
|
'''Expect no-suffix file to upload
|
||||||
|
Note that this skips the git commit process. That would need a new test.
|
||||||
Need to login first.
|
Need to login first.
|
||||||
'''
|
'''
|
||||||
c = self.client
|
c = self.client
|
||||||
@@ -214,7 +215,7 @@ class PostTests(TestCase):
|
|||||||
phmatch = re.search(ph, content)
|
phmatch = re.search(ph, content)
|
||||||
self.assertIsNotNone(phmatch, "Expect no-suffix file to upload OK. Failed to find expected text: '" + ph +"'")
|
self.assertIsNotNone(phmatch, "Expect no-suffix file to upload OK. Failed to find expected text: '" + ph +"'")
|
||||||
|
|
||||||
# Does not use the filename Django actually uses, assumes it is unchanged. Potential bug.
|
# Does not use the filename Django actually uses, assumes it is unchanged. Bug: accumulates one file with random name added each time it is run.
|
||||||
remove_file = pathlib.Path(settings.DRAWINGS_DATA) / 'uploads' / 'test_upload_nosuffix'
|
remove_file = pathlib.Path(settings.DRAWINGS_DATA) / 'uploads' / 'test_upload_nosuffix'
|
||||||
remove_file.unlink()
|
remove_file.unlink()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user