File: test_distributed_client_hashing.py

package info (click to toggle)
python-binary-memcached 0.31.2%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 304 kB
  • sloc: python: 1,722; makefile: 17
file content (12 lines) | stat: -rw-r--r-- 390 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
import unittest
import bmemcached


class DistributedClientHashingTest(unittest.TestCase):
    def test_get_server_is_consistent(self):
        key = 'the_key'
        servers = ['localhost:11211', 'localhost:11212', 'localhost:11213']

        for _ in range(10):
            client = bmemcached.DistributedClient(servers)
            self.assertEqual(client._get_server(key).port, 11211)