def test_rehashing(): """ Tests key rehashing for replication. """ count = 3 rehashed = rehash('example', count) assert len(rehashed) == count assert len(set(rehashed)) == count
def rehash(self, key): return map(lambda hash: '%s:%s' % (key, hash), rehash(key, self.replica_count))