Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_net.py
Show First 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | def test_getpeerinfo(self): | ||||
assert_equal(peer_info[1][0]['addrbind'], peer_info[0][0]['addr']) | assert_equal(peer_info[1][0]['addrbind'], peer_info[0][0]['addr']) | ||||
assert_equal(peer_info[0][0]['minfeefilter'], Decimal("5.00")) | assert_equal(peer_info[0][0]['minfeefilter'], Decimal("5.00")) | ||||
assert_equal(peer_info[1][0]['minfeefilter'], Decimal("10.00")) | assert_equal(peer_info[1][0]['minfeefilter'], Decimal("10.00")) | ||||
# check the `servicesnames` field | # check the `servicesnames` field | ||||
for info in peer_info: | for info in peer_info: | ||||
assert_net_servicesnames(int(info[0]["services"], 0x10), | assert_net_servicesnames(int(info[0]["services"], 0x10), | ||||
info[0]["servicesnames"]) | info[0]["servicesnames"]) | ||||
assert_equal(peer_info[0][0]['connection_type'], 'inbound') | |||||
assert_equal(peer_info[0][1]['connection_type'], 'manual') | |||||
assert_equal(peer_info[1][0]['connection_type'], 'manual') | |||||
assert_equal(peer_info[1][1]['connection_type'], 'inbound') | |||||
def test_service_flags(self): | def test_service_flags(self): | ||||
self.log.info("Test service flags") | self.log.info("Test service flags") | ||||
self.nodes[0].add_p2p_connection( | self.nodes[0].add_p2p_connection( | ||||
P2PInterface(), services=( | P2PInterface(), services=( | ||||
1 << 5) | ( | 1 << 5) | ( | ||||
1 << 63)) | 1 << 63)) | ||||
assert_equal(['UNKNOWN[2^5]', 'UNKNOWN[2^63]'], | assert_equal(['UNKNOWN[2^5]', 'UNKNOWN[2^63]'], | ||||
self.nodes[0].getpeerinfo()[-1]['servicesnames']) | self.nodes[0].getpeerinfo()[-1]['servicesnames']) | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |