def test_chr_add_node_duplicate(self): hosts = [ ("127.0.0.1", "cache0"), ("127.0.0.1", "cache1"), ("127.0.0.1", "cache2"), ] hashring = ConsistentHashRing(hosts) self.assertEqual(hashring.nodes, set(hosts)) hashring.add_node(("127.0.0.1", "cache2")) self.assertEqual(hashring.nodes, set(hosts)) self.assertEqual(hashring.nodes_len, 3)