예제 #1
0
파일: tests.py 프로젝트: tkaemming/dht
def test_rehashing():
    """
    Tests key rehashing for replication.
    """
    count = 3
    rehashed = rehash('example', count)
    assert len(rehashed) == count
    assert len(set(rehashed)) == count
예제 #2
0
 def rehash(self, key):
     return map(lambda hash: '%s:%s' % (key, hash),
         rehash(key, self.replica_count))