1
+ from unittest import TestCase
2
+
3
+ from mock import Mock
1
4
from sqlalchemy import create_engine
2
5
from sqlalchemy .engine .url import make_url
6
+ from testfixtures import (
7
+ Replacer , compare , ShouldRaise , LogCapture
8
+ )
3
9
from zope .sqlalchemy .datamanager import STATUS_CHANGED
4
10
5
11
from mortar_rdb import register_session
6
- from mortar_rdb .compat import empty_str
7
12
from mortar_rdb .interfaces import ISession
8
- from mock import Mock
9
- from sqlalchemy .orm .interfaces import SessionExtension
10
- from testfixtures import (
11
- Replacer , Comparison as C , compare , ShouldRaise , LogCapture
12
- )
13
- from unittest import TestCase
14
- from zope .sqlalchemy import ZopeTransactionExtension
13
+
15
14
16
15
class TestUtility (TestCase ):
17
16
@@ -244,7 +243,7 @@ def test_logging_normal(self):
244
243
l .check ((
245
244
'mortar_rdb' ,
246
245
'INFO' ,
247
- "Registering session for sqlite:// with name " + empty_str
246
+ "Registering session for sqlite:// with name ''"
248
247
))
249
248
250
249
def test_logging_password (self ):
@@ -257,7 +256,7 @@ def test_logging_password(self):
257
256
'mortar_rdb' ,
258
257
'INFO' ,
259
258
"Registering session for "
260
- "mysql://user:***@localhost/db with name " + empty_str
259
+ "mysql://user:***@localhost/db with name ''"
261
260
))
262
261
263
262
def test_logging_username_password_db_same (self ):
@@ -270,7 +269,7 @@ def test_logging_username_password_db_same(self):
270
269
'mortar_rdb' ,
271
270
'INFO' ,
272
271
"Registering session for "
273
- "mysql://proj:***@localhost/proj with name " + empty_str
272
+ "mysql://proj:***@localhost/proj with name ''"
274
273
))
275
274
276
275
def test_logging_name (self ):
0 commit comments