mirror of
https://github.com/yweber/lodel2.git
synced 2025-10-30 11:09:03 +01:00
New way to run test via loader & conf
This commit is contained in:
parent
28d7c20d44
commit
a3b3102604
6 changed files with 18 additions and 6 deletions
|
|
@ -7,6 +7,7 @@ import sys, os
|
|||
LODEL2_LIB_ABS_PATH = None
|
||||
if LODEL2_LIB_ABS_PATH is not None:
|
||||
sys.path.append(os.path.dirname(LODEL2_LIB_ABS_PATH))
|
||||
sys.path.append(os.path.dirname(LODEL2_LIB_ABS_PATH))
|
||||
|
||||
try:
|
||||
import lodel
|
||||
|
|
@ -36,6 +37,16 @@ def start():
|
|||
|
||||
if __name__ == '__main__':
|
||||
start()
|
||||
|
||||
if Settings.runtest:
|
||||
import unittest
|
||||
import tests
|
||||
loader = unittest.TestLoader()
|
||||
suite = loader.discover('tests')
|
||||
runner = unittest.TextTestRunner()
|
||||
runner.run(suite)
|
||||
exit()
|
||||
|
||||
LodelHook.call_hook('lodel2_loader_main', '__main__', None)
|
||||
#Run interative python
|
||||
import code
|
||||
|
|
|
|||
|
|
@ -308,6 +308,8 @@ LODEL2_CONF_SPECS = {
|
|||
SettingValidator('strip')),
|
||||
'lib_path': ( None,
|
||||
SettingValidator('path')),
|
||||
'runtest': ( True,
|
||||
SettingValidator('bool')),
|
||||
},
|
||||
'lodel2.logging.*' : {
|
||||
'level': ( 'ERROR',
|
||||
|
|
|
|||
4
runtest
4
runtest
|
|
@ -53,6 +53,8 @@ cp -R examples $testdir
|
|||
cp -R tests $testdir
|
||||
cd $testdir
|
||||
rm -R conf.d && mv tests/tests_conf.d conf.d
|
||||
python3 -W ignore -m unittest $@
|
||||
make
|
||||
#python3 -W ignore -m unittest $@
|
||||
python3 loader.py
|
||||
|
||||
rm -Rf $testdir
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
try:
|
||||
import loader
|
||||
except ImportError:
|
||||
print("This tests are designed to be runned with the runtest utility")
|
||||
|
|
@ -3,7 +3,7 @@ from unittest import mock
|
|||
from unittest.mock import patch
|
||||
|
||||
import tests.loader_utils
|
||||
from tests.leapi.query.utils import dyncode_module as dyncode
|
||||
import leapi_dyncode as dyncode
|
||||
|
||||
from lodel.leapi.leobject import LeObject
|
||||
from lodel.leapi.query import LeDeleteQuery, LeUpdateQuery, LeGetQuery, \
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ debug = False
|
|||
sitename = noname
|
||||
plugins_path = /foo/plugins
|
||||
plugins = dummy, dummy_datasource
|
||||
runtest=True
|
||||
|
||||
[lodel2.logging.stderr]
|
||||
level = Error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue