| 1727 | self.assertEqual(cache._cache.behaviors["tcp_nodelay"], int(True)) |
| 1728 | |
| 1729 | def test_pylibmc_client_servers(self): |
| 1730 | backend = self.base_params["BACKEND"] |
| 1731 | tests = [ |
| 1732 | ("unix:/run/memcached/socket", "/run/memcached/socket"), |
| 1733 | ("/run/memcached/socket", "/run/memcached/socket"), |
| 1734 | ("localhost", "localhost"), |
| 1735 | ("localhost:11211", "localhost:11211"), |
| 1736 | ("[::1]", "[::1]"), |
| 1737 | ("[::1]:11211", "[::1]:11211"), |
| 1738 | ("127.0.0.1", "127.0.0.1"), |
| 1739 | ("127.0.0.1:11211", "127.0.0.1:11211"), |
| 1740 | ] |
| 1741 | for location, expected in tests: |
| 1742 | settings = {"default": {"BACKEND": backend, "LOCATION": location}} |
| 1743 | with self.subTest(location), self.settings(CACHES=settings): |
| 1744 | self.assertEqual(cache.client_servers, [expected]) |
| 1745 | |
| 1746 | |
| 1747 | @unittest.skipUnless(PyMemcacheCache_params, "PyMemcacheCache backend not configured") |