We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05cff79 commit fd7c625Copy full SHA for fd7c625
test/test_redis_connect_host.py
@@ -17,11 +17,15 @@ def test_redis_connect_host():
17
db.dbintf = mock_dbintf
18
db.dbintf.redis_kwargs = {}
19
20
- db_name = 'COUNTERS_DB'
21
- host = '127.0.0.1'
+ counters_db = 'COUNTERS_DB'
+ host_ip = '127.0.0.1'
22
23
- db.connect_host(db_name, host)
24
- mock_dbintf.connect.assert_called_once_with(2, db_name, True)
+ def mocked_connect(db_id, db_name, retry_on):
+ assert db_id == 2
25
+ assert db_name == counters_db
26
- assert db.dbintf.redis_kwargs["host"] == host
27
+ db.dbintf.connect = mocked_connect
28
+ db.connect_host(counters_db, host_ip)
29
+
30
+ assert db.dbintf.redis_kwargs["host"] == host_ip
31
assert db.dbintf.redis_kwargs["port"] == 6379
0 commit comments