Call the db connection helper using the right parameters. --- .../server/test/unit-test/rhnSQL/test_exceptions.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/backend/server/test/unit-test/rhnSQL/test_exceptions.py b/backend/server/test/unit-test/rhnSQL/test_exceptions.py index f0b78c6..4d1b25d 100644 --- a/backend/server/test/unit-test/rhnSQL/test_exceptions.py +++ b/backend/server/test/unit-test/rhnSQL/test_exceptions.py @@ -9,7 +9,24 @@ from spacewalk.server import rhnSQL class ExceptionsTest(unittest.TestCase): def test_failed_connection(self): - self.assertRaises(rhnSQL.SQLConnectError, rhnSQL.initDB, 'x/y@z') + # Connect to localhost and look for db on a totally bogus port, this + # makes the test faster. + host = "localhost" + username = "x" + password = "y" + database = "z" + port = 9000 + + self.assertRaises( + rhnSQL.SQLConnectError, + rhnSQL.initDB, + "oracle", + host, + port, + database, + username, + password + ) if __name__ == '__main__': unittest.main() -- 1.8.4 _______________________________________________ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel