コード例 #1
0
 def test_db(self):
     self.assertEqual(SentinelExtension._config_from_variables({'DB': 2}, redis.StrictRedis),
                      {'db': 2})
コード例 #2
0
 def test_host(self):
     self.assertEqual(SentinelExtension._config_from_variables({'HOST': 'otherhost'}, redis.StrictRedis),
                      {'host': 'otherhost'})
コード例 #3
0
 def test_host_file_url(self):
     self.assertEqual(SentinelExtension._config_from_variables({'HOST': 'file:///path/to/socket'}, redis.StrictRedis),
                      {'unix_socket_path': 'file:///path/to/socket'})
コード例 #4
0
 def test_empty_settings(self):
     self.assertEqual(SentinelExtension._config_from_variables({}, redis.StrictRedis), {})
コード例 #5
0
 def test_port(self):
     self.assertEqual(SentinelExtension._config_from_variables({'PORT': 7379}, redis.StrictRedis)['port'], 7379)
コード例 #6
0
 def test_db(self):
     self.assertEqual(
         SentinelExtension._config_from_variables({'DB': 2},
                                                  redis.StrictRedis),
         {'db': 2})
コード例 #7
0
 def test_host_file_url(self):
     self.assertEqual(
         SentinelExtension._config_from_variables(
             {'HOST': 'file:///path/to/socket'}, redis.StrictRedis),
         {'unix_socket_path': 'file:///path/to/socket'})
コード例 #8
0
 def test_host(self):
     self.assertEqual(
         SentinelExtension._config_from_variables({'HOST': 'otherhost'},
                                                  redis.StrictRedis),
         {'host': 'otherhost'})
コード例 #9
0
 def test_port(self):
     self.assertEqual(
         SentinelExtension._config_from_variables(
             {'PORT': 7379}, redis.StrictRedis)['port'], 7379)
コード例 #10
0
 def test_empty_settings(self):
     self.assertEqual(
         SentinelExtension._config_from_variables({}, redis.StrictRedis),
         {})