示例#1
0
    def test_max_connections(self):
        pool = pool_from_config({
            "memcache.endpoint": "localhost:1234",
            "memcache.max_pool_size": 300,
        })

        self.assertEqual(pool.client_pool.max_size, 300)
示例#2
0
    def test_max_connections(self):
        pool = pool_from_config({
            "memcache.endpoint": "localhost:1234",
            "memcache.max_pool_size": 300,
        })

        self.assertEqual(pool.client_pool.max_size, 300)
示例#3
0
    def test_basic_url(self):
        pool = pool_from_config({
            "memcache.endpoint": "localhost:1234",
        })

        self.assertEqual(pool.server[0], "localhost")
        self.assertEqual(pool.server[1], 1234)
示例#4
0
    def test_basic_url(self):
        pool = pool_from_config({
            "memcache.endpoint": "localhost:1234",
        })

        self.assertEqual(pool.server[0], "localhost")
        self.assertEqual(pool.server[1], 1234)
示例#5
0
    def test_timeouts(self):
        pool = pool_from_config({
            "memcache.endpoint": "localhost:1234",
            "memcache.timeout": 1.23,
            "memcache.connect_timeout": 4.56,
        })

        self.assertEqual(pool.timeout, 1.23)
        self.assertEqual(pool.connect_timeout, 4.56)
示例#6
0
    def test_timeouts(self):
        pool = pool_from_config({
            "memcache.endpoint": "localhost:1234",
            "memcache.timeout": 1.23,
            "memcache.connect_timeout": 4.56,
        })

        self.assertEqual(pool.timeout, 1.23)
        self.assertEqual(pool.connect_timeout, 4.56)
示例#7
0
 def test_alternate_prefix(self):
     pool_from_config({
         "noodle.endpoint": "localhost:1234",
     },
                      prefix="noodle.")
示例#8
0
 def test_empty_config(self):
     with self.assertRaises(ConfigurationError):
         pool_from_config({})
示例#9
0
 def test_nodelay(self):
     pool = pool_from_config({
         "memcache.endpoint": "localhost:1234",
         "memcache.no_delay": "False"
     })
     self.assertEqual(pool.no_delay, False)
示例#10
0
 def test_nodelay(self):
     pool = pool_from_config({
         "memcache.endpoint": "localhost:1234",
         "memcache.no_delay": "False",
     })
     self.assertEqual(pool.no_delay, False)
示例#11
0
 def test_alternate_prefix(self):
     pool_from_config({
         "noodle.endpoint": "localhost:1234",
     }, prefix="noodle.")
示例#12
0
 def test_empty_config(self):
     with self.assertRaises(ConfigurationError):
         pool_from_config({})