2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-14 02:07:07 +00:00

Unit tests outline implemented

This commit is contained in:
Philip Sargent
2020-06-03 21:57:05 +01:00
parent 973c6f4ef8
commit ae89a707ec
4 changed files with 73 additions and 29 deletions

View File

@@ -32,6 +32,9 @@ expouser=settings.EXPOUSER
expouserpass=settings.EXPOUSERPASS
expouseremail=settings.EXPOUSER_EMAIL
def call_django_tests(n):
management.call_command('test', verbosity=n)
def reinit_db():
"""Rebuild database from scratch. Deletes the file first if sqlite is used,
otherwise it drops the database and creates it.
@@ -89,6 +92,11 @@ def import_QMs():
print("Importing QMs (old caves)")
import troggle.parsers.QMs
# import process itself runs on qm.csv in only 3 old caves, not the modern ones!
def import_surveyscans():
import troggle.parsers.surveys
print("Importing Survey Scans")
troggle.parsers.surveys.LoadListScans()
def import_survexblks():
import troggle.parsers.survex
@@ -108,11 +116,6 @@ def import_surveyimgs():
print("NOT Importing survey images")
#troggle.parsers.surveys.parseSurveys(logfile=settings.LOGFILE)
def import_surveyscans():
import troggle.parsers.surveys
print("Importing Survey Scans")
troggle.parsers.surveys.LoadListScans()
def import_tunnelfiles():
import troggle.parsers.surveys
print("Importing Tunnel files")
@@ -415,13 +418,15 @@ if __name__ == "__main__":
runlabel = sys.argv[len(sys.argv)-1]
else:
runlabel=None
call_django_tests(1)
jq = JobQueue(runlabel)
if len(sys.argv)==1:
usage()
exit()
elif "test" in sys.argv:
call_django_tests(2)
jq.enq("caves",import_caves)
jq.enq("people",import_people)
elif "caves" in sys.argv: