change for tests

This commit is contained in:
2020-08-19 11:36:18 +02:00
parent e787eb2ef5
commit a64131fb03
6 changed files with 398 additions and 282 deletions

View File

@ -1,5 +1,15 @@
from tiramisu import Storage
from risotto.config import DATABASE_DIR
try:
from tiramisu3 import Storage
except:
from tiramisu import Storage
from os.path import isfile as _isfile
import os as _os
_envfile = '/etc/risotto/risotto.conf'
if _isfile(_envfile):
with open(_envfile, 'r') as fh_env:
for line in fh_env.readlines():
key, value = line.strip().split('=')
_os.environ[key] = value
STORAGE = Storage(engine='sqlite3', dir_database=DATABASE_DIR, name='test')
STORAGE = Storage(engine='sqlite3')