Skip to content

Commit bd57dcb

Browse files
committed
test: hoist proxy out of 2 network loops in feature_proxy.py
1 parent afdf2de commit bd57dcb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/functional/feature_proxy.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,13 @@ def networks_dict(d):
263263

264264
n2 = networks_dict(self.nodes[2].getnetworkinfo())
265265
assert_equal(NETWORKS, n2.keys())
266+
proxy = f'{self.conf2.addr[0]}:{self.conf2.addr[1]}'
266267
for net in NETWORKS:
267268
if net == NET_I2P:
268269
expected_proxy = ''
269270
expected_randomize = False
270271
else:
271-
expected_proxy = f'{self.conf2.addr[0]}:{self.conf2.addr[1]}'
272+
expected_proxy = proxy
272273
expected_randomize = True
273274
assert_equal(n2[net]['proxy'], expected_proxy)
274275
assert_equal(n2[net]['proxy_randomize_credentials'], expected_randomize)
@@ -279,11 +280,9 @@ def networks_dict(d):
279280
if self.have_ipv6:
280281
n3 = networks_dict(self.nodes[3].getnetworkinfo())
281282
assert_equal(NETWORKS, n3.keys())
283+
proxy = f'[{self.conf3.addr[0]}]:{self.conf3.addr[1]}'
282284
for net in NETWORKS:
283-
if net == NET_I2P or net == NET_ONION:
284-
expected_proxy = ''
285-
else:
286-
expected_proxy = f'[{self.conf3.addr[0]}]:{self.conf3.addr[1]}'
285+
expected_proxy = '' if net == NET_I2P or net == NET_ONION else proxy
287286
assert_equal(n3[net]['proxy'], expected_proxy)
288287
assert_equal(n3[net]['proxy_randomize_credentials'], False)
289288
assert_equal(n3['onion']['reachable'], False)

0 commit comments

Comments
 (0)