Пример #1
0
 def setUp(self):
     self.cf = pool.get_connection_factory(options={})
     self.constring1 = "127.0.0.1:6379:1"
     self.constring2 = "localhost:6379:2"
     self.constring3 = "unix:/tmp/foo.bar:2"
     self.constring4 = "unix://tmp/foo.bar?db=1"
     self.constring5 = "redis://localhost/2"
     self.constring6 = "rediss://localhost:3333?db=2"
Пример #2
0
 def setUp(self):
     self.cf = pool.get_connection_factory(options={})
     self.constring1 = "127.0.0.1:6379:1"
     self.constring2 = "localhost:6379:2"
     self.constring3 = "unix:/tmp/foo.bar:2"
     self.constring4 = "unix://tmp/foo.bar?db=1"
     self.constring5 = "redis://localhost/2"
     self.constring6 = "rediss://localhost:3333?db=2"
Пример #3
0
 def test_connection_strings(self):
     connection_strings = [
         "unix://tmp/foo.bar?db=1",
         "redis://localhost/2",
         "rediss://localhost:3333?db=2",
     ]
     cf = pool.get_connection_factory(options={})
     for connection_string in connection_strings:
         with self.subTest(connection_string):
             res = cf.make_connection_params(connection_string)
             self.assertEqual(res["url"], connection_string)
Пример #4
0
 def setUp(self):
     self.cf = pool.get_connection_factory(options={})
     self.constring4 = "unix://tmp/foo.bar?db=1"
     self.constring5 = "redis://localhost/2"
     self.constring6 = "rediss://localhost:3333?db=2"
Пример #5
0
 def setUp(self):
     self.cf = pool.get_connection_factory(options={})
     self.constring4 = "unix://tmp/foo.bar?db=1"
     self.constring5 = "redis://localhost/2"
     self.constring6 = "rediss://localhost:3333?db=2"
def test_connection_strings(connection_string: str):
    cf = pool.get_connection_factory(
        path="django_redis.pool.ConnectionFactory", options={})
    res = cf.make_connection_params(connection_string)
    assert res["url"] == connection_string