Skip to content

Commit 03aa3dd

Browse files
committed
Correct test after merge and correct support for python3
1 parent 5df97b3 commit 03aa3dd

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

rdflib_sqlalchemy/SQLAlchemy.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727

2828
if PY3:
2929
from functools import reduce
30+
from urllib.parse import unquote_plus
31+
else:
32+
from urllib import unquote_plus
3033

3134
_logger = logging.getLogger(__name__)
3235

@@ -107,7 +110,7 @@ def _parse_rfc1738_args(name):
107110
opts = {'username': username, 'password': password, 'host':
108111
host, 'port': port, 'database': database, 'query': query}
109112
if opts['password'] is not None:
110-
opts['password'] = urllib.unquote_plus(opts['password'])
113+
opts['password'] = unquote_plus(opts['password'])
111114
return (name, opts)
112115
else:
113116
raise ValueError("Could not parse rfc1738 URL from string '%s'" % name)
@@ -1124,7 +1127,7 @@ def bind(self, prefix, namespace):
11241127
""" """
11251128
with self.engine.connect() as connection:
11261129
try:
1127-
ins = self.tables['namespace_binds'].insert().values(prefix=prefix, uri=namesapce)
1130+
ins = self.tables['namespace_binds'].insert().values(prefix=prefix, uri=namespace)
11281131
connection.execute(ins)
11291132
except Exception:
11301133
e = sys.exc_info()[1]

test/context_case.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ def cid(c):
182182
if (PY3 and not isinstance(c,(str, bytes))) or not isinstance(c, basestring):
183183
return c.identifier
184184
return c
185-
self.assert_(self.c1 in map(cid, self.graph.contexts()))
186-
self.assert_(self.c2 in map(cid, self.graph.contexts()))
185+
self.assert_(self.c1 in list(map(cid, self.graph.contexts())))
186+
self.assert_(self.c2 in list(map(cid, self.graph.contexts())))
187187

188-
contextList = map(cid, list(self.graph.contexts(triple)))
188+
contextList = list(map(cid, list(self.graph.contexts(triple))))
189189
self.assert_(self.c1 in contextList)
190190
self.assert_(self.c2 in contextList)
191191

test/test_sqlalchemy_postgresql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
raise SkipTest("psycopg2 not installed, skipping PgSQL tests")
1010
import logging
1111
_logger = logging.getLogger(__name__)
12-
import context_case
13-
import graph_case
12+
from . import context_case
13+
from . import graph_case
1414

1515
sqlalchemy_url = os.environ.get(
1616
'DBURI',

0 commit comments

Comments
 (0)