2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 11:28:23 +00:00

new tests for CAVERN and SURVEXPORT

This commit is contained in:
2021-05-13 23:15:30 +03:00
parent 6410cc1090
commit 9130160bd6
3 changed files with 30 additions and 1 deletions

View File

@@ -20,12 +20,15 @@ https://docs.djangoproject.com/en/3.0/topics/testing/tools/
"""
import unittest
import re
import subprocess
from django.test import TestCase, SimpleTestCase, Client
class SimpleTest(SimpleTestCase):
def test_test_setting(self):
from django.conf import settings
self.assertEqual(settings.EMAIL_BACKEND, 'django.core.mail.backends.locmem.EmailBackend')
import troggle.settings as settings
def test_import_TroggleModel(self):
from troggle.core.models.troggle import TroggleModel
def test_import_Cave(self):
@@ -105,5 +108,28 @@ class SimpleTest(SimpleTestCase):
from troggle.core.views.statistics import pathsreport, stats, dataissues
from troggle.core.views.survex import survexcaveslist, survexcavesingle, svx
class SubprocessTest(TestCase):
@classmethod
def setUpTestData(cls):
pass
def setUp(self):
pass
def tearDown(self):
pass
def test_installs(self):
import troggle.settings as settings
for i in [settings.CAVERN, settings.SURVEXPORT]:
# Define command as string and then split() into list format
cmd = f'which {i}'.split()
try:
sp = subprocess.check_call(cmd, shell=False)
except subprocess.CalledProcessError:
self.assertTrue( False, f'no {i} installed')