Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_net.py
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | def _test_getaddednodeinfo(self): | ||||
assert_equal(added_nodes[0]['addednode'], ip_port) | assert_equal(added_nodes[0]['addednode'], ip_port) | ||||
# check that a non-existent node returns an error | # check that a non-existent node returns an error | ||||
assert_raises_rpc_error(-24, "Node has not been added", | assert_raises_rpc_error(-24, "Node has not been added", | ||||
self.nodes[0].getaddednodeinfo, '1.1.1.1') | self.nodes[0].getaddednodeinfo, '1.1.1.1') | ||||
def _test_getpeerinfo(self): | def _test_getpeerinfo(self): | ||||
peer_info = [x.getpeerinfo() for x in self.nodes] | peer_info = [x.getpeerinfo() for x in self.nodes] | ||||
# check both sides of bidirectional connection between nodes | # check both sides of bidirectional connection between nodes | ||||
# the address bound to on one side will be the source address for the other node | # the address bound to on one side will be the source address for the | ||||
# other node | |||||
assert_equal(peer_info[0][0]['addrbind'], peer_info[1][0]['addr']) | assert_equal(peer_info[0][0]['addrbind'], peer_info[1][0]['addr']) | ||||
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("0.00000500")) | assert_equal(peer_info[0][0]['minfeefilter'], Decimal("0.00000500")) | ||||
assert_equal(peer_info[1][0]['minfeefilter'], Decimal("0.00001000")) | assert_equal(peer_info[1][0]['minfeefilter'], Decimal("0.00001000")) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
NetTest().main() | NetTest().main() |