def test_hash_with_single_client(self): clients = [FakeClient("127.0.0.1", 10001)] client = ConsistentHashingClient(clients) bar = Metric(client, "bar") foo = Metric(client, "foo") dba = Metric(client, "dba") bar.send("1") foo.send("1") dba.send("1") self.assertEqual(clients[0].data, ["bar:1", "foo:1", "dba:1"])
def test_hash_with_single_client(self): clients = [ FakeClient("127.0.0.1", 10001), ] client = ConsistentHashingClient(clients) bar = Metric(client, "bar") foo = Metric(client, "foo") dba = Metric(client, "dba") bar.send("1") foo.send("1") dba.send("1") self.assertEqual(clients[0].data, ["bar:1", "foo:1", "dba:1"])