Exemple #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)
Exemple #2
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)
Exemple #3
0
 def test_nodelay(self):
     pool = pool_from_config({
         "memcache.endpoint": "localhost:1234",
         "memcache.no_delay": "False"
     })
     self.assertEqual(pool.no_delay, False)
Exemple #4
0
 def test_alternate_prefix(self):
     pool_from_config({"noodle.endpoint": "localhost:1234"},
                      prefix="noodle.")
Exemple #5
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)
Exemple #6
0
 def test_empty_config(self):
     with self.assertRaises(ConfigurationError):
         pool_from_config({})