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:
parent
ca6af9432b
commit
5a14b0c9f0
1 changed files with 14 additions and 0 deletions
14
tests/utils.py
Normal file
14
tests/utils.py
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue