Skip to content

Commit 4c6108d

Browse files
committed
updated tests
1 parent 3113628 commit 4c6108d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/sql.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ class MySQLTests(SQLTests):
151151
@classmethod
152152
def setUpClass(self):
153153
self.db = SQL("mysql://root@localhost/test")
154+
self.db = SQL("mysql://root@127.0.0.1/test")
154155

155156
def setUp(self):
156157
self.db.execute("CREATE TABLE IF NOT EXISTS cs50 (id INTEGER NOT NULL AUTO_INCREMENT, val VARCHAR(16), bin BLOB, PRIMARY KEY (id))")
@@ -160,7 +161,7 @@ def setUp(self):
160161
class PostgresTests(SQLTests):
161162
@classmethod
162163
def setUpClass(self):
163-
self.db = SQL("postgresql://postgres@localhost/test")
164+
self.db = SQL("postgresql://postgres:postgres@127.0.0.1/test")
164165

165166
def setUp(self):
166167
self.db.execute("CREATE TABLE IF NOT EXISTS cs50 (id SERIAL PRIMARY KEY, val VARCHAR(16), bin BYTEA)")
@@ -169,6 +170,10 @@ def setUp(self):
169170
def test_cte(self):
170171
self.assertEqual(self.db.execute("WITH foo AS ( SELECT 1 AS bar ) SELECT bar FROM foo"), [{"bar": 1}])
171172

173+
def test_postgres_scheme(self):
174+
db = SQL("postgres://postgres:postgres@127.0.0.1/test")
175+
db.execute("SELECT 1")
176+
172177

173178
class SQLiteTests(SQLTests):
174179

0 commit comments

Comments
 (0)