MCPcopy
hub / github.com/django/django / test_pylibmc_client_servers

Method test_pylibmc_client_servers

tests/cache/tests.py:1729–1744  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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")

Callers

nothing calls this directly

Calls 1

settingsMethod · 0.45

Tested by

no test coverage detected