def test_ping_sp_cmd(self): hb = NodeHeartBeat(interval=20) ip = '1.1.1.1' hb.add('spa', ip) hb.update_by_ip(ip, latency=5.123) assert_that(' '.join(hb.get_agent(ip)), ends_with('-h 1.1.1.1 -t 35 -np getagent')) hb.stop()
def test_ping_sp_cmd(self): hb = NodeHeartBeat(interval=20) ip = '1.1.1.1' hb.add('spa', ip) hb.update_by_ip(ip, latency=5.123) assert_that(' '.join(hb.get_agent(ip)), ends_with('-h 1.1.1.1 -t 35 -np getagent')) hb.stop()
def test_update_by_ip(self): hb = NodeHeartBeat(interval=0) hb.add('spa', '1.1.1.1', False) hb.add('spb', '1.1.1.2', False) hb.update_by_ip('1.1.1.1', True) assert_that(hb.get_alive_sp_ip(), equal_to('1.1.1.1'))
def test_update_by_ip(self): hb = NodeHeartBeat(interval=0) hb.add('spa', '1.1.1.1', False) hb.add('spb', '1.1.1.2', False) hb.update_by_ip('1.1.1.1', True) assert_that(hb.get_alive_sp_ip(), equal_to('1.1.1.1'))