Moved db connection settings to a dedicated file.
---
 backend/server/test/unit-test/rhnSQL/db_settings.ini        |  4 ++++
 backend/server/test/unit-test/rhnSQL/test_misc_functions.py | 10 +++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
 create mode 100644 backend/server/test/unit-test/rhnSQL/db_settings.ini

diff --git a/backend/server/test/unit-test/rhnSQL/db_settings.ini 
b/backend/server/test/unit-test/rhnSQL/db_settings.ini
new file mode 100644
index 0000000..18b7776
--- /dev/null
+++ b/backend/server/test/unit-test/rhnSQL/db_settings.ini
@@ -0,0 +1,4 @@
+[oracle]
+user: rhnuser
+password: rhnuser
+database: webdev
diff --git a/backend/server/test/unit-test/rhnSQL/test_misc_functions.py 
b/backend/server/test/unit-test/rhnSQL/test_misc_functions.py
index 04f038b..40536bd 100644
--- a/backend/server/test/unit-test/rhnSQL/test_misc_functions.py
+++ b/backend/server/test/unit-test/rhnSQL/test_misc_functions.py
@@ -24,14 +24,18 @@ from spacewalk.server import rhnSQL
 
 import misc_functions
 
-DB = 'rhnuser/rhnuser@webdev'
-
+DB_SETTINGS = misc_functions.db_settings("oracle")
 
 class Tests(unittest.TestCase):
 
     def setUp(self):
         initCFG("server")
-        rhnSQL.initDB(DB)
+        rhnSQL.initDB(
+            backend  = "oracle",
+            username = DB_SETTINGS["user"],
+            password = DB_SETTINGS["password"],
+            database = DB_SETTINGS["database"]
+        )
 
     def tearDown(self):
         # Roll back any unsaved data
-- 
1.8.4

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to