Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #7
0
 def test_alternate_prefix(self):
     pool_from_config({
         "noodle.endpoint": "localhost:1234",
     },
                      prefix="noodle.")
Beispiel #8
0
 def test_empty_config(self):
     with self.assertRaises(ConfigurationError):
         pool_from_config({})
Beispiel #9
0
 def test_nodelay(self):
     pool = pool_from_config({
         "memcache.endpoint": "localhost:1234",
         "memcache.no_delay": "False"
     })
     self.assertEqual(pool.no_delay, False)
Beispiel #10
0
 def test_nodelay(self):
     pool = pool_from_config({
         "memcache.endpoint": "localhost:1234",
         "memcache.no_delay": "False",
     })
     self.assertEqual(pool.no_delay, False)
Beispiel #11
0
 def test_alternate_prefix(self):
     pool_from_config({
         "noodle.endpoint": "localhost:1234",
     }, prefix="noodle.")
Beispiel #12
0
 def test_empty_config(self):
     with self.assertRaises(ConfigurationError):
         pool_from_config({})