1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-04-17 14:39:58 +02:00

Added a utils module in the tests package to collect the commonly used functions

The first ones will be the functions used for the setup and teardown of the datasource based tests
This commit is contained in:
Roland Haroutiounian 2016-06-10 17:19:29 +02:00
commit 5a14b0c9f0

14
tests/utils.py Normal file
View file

@ -0,0 +1,14 @@
from plugins.mongodb_datasource.utils import connection
def datasource_tests_init(conn_args):
conn = connection(host=conn_args['host'],
port=conn_args['port'],
username=conn_args['username'],
password=conn_args['password'])
database = conn[conn_args['db_name']]
return (conn, database)
def datasource_tests_clean(conn, dbname):
conn.drop_database(dbname)