Pārlūkot izejas kodu

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
Roland Haroutiounian 8 gadus atpakaļ
vecāks
revīzija
5a14b0c9f0
1 mainītis faili ar 14 papildinājumiem un 0 dzēšanām
  1. 14
    0
      tests/utils.py

+ 14
- 0
tests/utils.py Parādīt failu

@@ -0,0 +1,14 @@
1
+from plugins.mongodb_datasource.utils import connection
2
+
3
+
4
+def datasource_tests_init(conn_args):
5
+    conn = connection(host=conn_args['host'],
6
+                      port=conn_args['port'],
7
+                      username=conn_args['username'],
8
+                      password=conn_args['password'])
9
+    database = conn[conn_args['db_name']]
10
+    return (conn, database)
11
+
12
+
13
+def datasource_tests_clean(conn, dbname):
14
+    conn.drop_database(dbname)

Notiek ielāde…
Atcelt
Saglabāt