Changeset: 7130f85de65b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7130f85de65b
Modified Files:
sql/test/Users/Tests/unknown_user.SQL.py
Branch: mtest
Log Message:
convert tests for unknown_user
diffs (52 lines):
diff --git a/sql/test/Users/Tests/unknown_user.SQL.py
b/sql/test/Users/Tests/unknown_user.SQL.py
--- a/sql/test/Users/Tests/unknown_user.SQL.py
+++ b/sql/test/Users/Tests/unknown_user.SQL.py
@@ -2,23 +2,32 @@
# Authenticate unknown USER (not possible).
###
-import sys,os
-import pymonetdb
+from MonetDBtesting.sqltest import SQLTestCase
+
+err_msg = "InvalidCredentialsException:checkCredentials:invalid credentials
for user 'this_user_does_not_exist'".strip()
-import logging
+with SQLTestCase() as tc:
+ tc.connect(username="this_user_does_not_exist",
password="this_password_does_not_exist")
+ tc.execute("SELECT * FROM sys;").assertFailed(err_message=err_msg)
+
-logging.basicConfig(level=logging.FATAL)
+# import sys,os
+# import pymonetdb
+
+# import logging
-error = False
-db=os.getenv("TSTDB")
-port=int(os.getenv("MAPIPORT"))
-try:
- client = pymonetdb.connect(database=db, port=port, autocommit=True,
- user='this_user_does_not_exist',
password='this_password_does_not_exist')
-except pymonetdb.exceptions.DatabaseError:
- error = True
- pass
+# logging.basicConfig(level=logging.FATAL)
-if not error:
- print("Logged in with invalid credentials")
- sys.exit(-1)
+# error = False
+# db=os.getenv("TSTDB")
+# port=int(os.getenv("MAPIPORT"))
+# try:
+# client = pymonetdb.connect(database=db, port=port, autocommit=True,
+# user='this_user_does_not_exist',
password='this_password_does_not_exist')
+# except pymonetdb.exceptions.DatabaseError:
+# error = True
+# pass
+
+# if not error:
+# print("Logged in with invalid credentials")
+# sys.exit(-1)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list