forked from expo/troggle
new tests for CAVERN and SURVEXPORT
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user