def test_connect_with_two_clients(self):
     clients = [
         FakeClient("127.0.0.1", 10001),
         FakeClient("127.0.0.1", 10002),
     ]
     client = ConsistentHashingClient(clients)
     client.connect()
     self.assertTrue(clients[0].connect_called)
     self.assertTrue(clients[1].connect_called)
Beispiel #2
0
 def test_connect_with_two_clients(self):
     clients = [
         FakeClient("127.0.0.1", 10001),
         FakeClient("127.0.0.1", 10002),
         ]
     client = ConsistentHashingClient(clients)
     client.connect()
     self.assertTrue(clients[0].connect_called)
     self.assertTrue(clients[1].connect_called)
Beispiel #3
0
 def test_udpstatsd_socket_nonblocking(self):
     client = UdpStatsDClient("localhost", 8000)
     client.connect()
     # According to the python docs (and the source, I've checked)
     # setblocking(0) is the same as settimeout(0.0).
     self.assertEqual(client.socket.gettimeout(), 0.0)
 def test_udpstatsd_socket_nonblocking(self):
     client = UdpStatsDClient('localhost', 8000)
     client.connect()
     # According to the python docs (and the source, I've checked)
     # setblocking(0) is the same as settimeout(0.0).
     self.assertEqual(client.socket.gettimeout(), 0.0)