commit 778216d82a7ed55a8e3b5fc53fcd655abb8d6df9 Author: Damian Johnson atagar@torproject.org Date: Thu Dec 12 15:14:39 2019 -0800
Fix indentation
Stem uses two rather than four space indentations. Also condensing the line wrapped statements (stem doesn't use them, imho they impair readability). --- test/integ/control/controller.py | 60 ++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 33 deletions(-)
diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py index d145272e..47c7d072 100644 --- a/test/integ/control/controller.py +++ b/test/integ/control/controller.py @@ -256,39 +256,33 @@ class TestController(unittest.TestCase):
@test.require.controller def test_getinfo_freshrelaydescs(self): - """ - Exercises the GETINFO option status/fresh-relay-descs - """ - - runner = test.runner.get_runner() - - with runner.get_tor_controller() as controller: - controller.set_conf("Address", "1.2.3.4") - relay_descs = controller.get_info('status/fresh-relay-descs') - - # check that both the server descriptor and extra info parts exist in - # the response by looking for the 'extra-info' entry - relay_descs = relay_descs.split("extra-info ") - self.assertTrue(len(relay_descs) == 2) - - # check integrity and compliance of descriptors by parsing with - # validate flags on - server_desc = \ - stem.descriptor.server_descriptor.ServerDescriptor(relay_descs[0], - validate = True) - extra_info = \ - stem.descriptor.extrainfo_descriptor.\ - ExtraInfoDescriptor("extra-info " + relay_descs[1], - validate = True) - - # check the contents of a few fields: as retrieved from controller; - # as compared between descriptors; as set by SETCONF; and as set by - # torrc - self.assertTrue(extra_info.nickname == server_desc.nickname == - controller.get_conf("Nickname")) - self.assertEqual(server_desc.fingerprint, extra_info.fingerprint) - self.assertEqual(server_desc.address, "1.2.3.4") - self.assertEqual(1113, server_desc.or_port) + """ + Exercises the GETINFO option status/fresh-relay-descs + """ + + runner = test.runner.get_runner() + + with runner.get_tor_controller() as controller: + controller.set_conf("Address", "1.2.3.4") + relay_descs = controller.get_info('status/fresh-relay-descs') + + # check that both the server descriptor and extra info parts exist in + # the response by looking for the 'extra-info' entry + relay_descs = relay_descs.split("extra-info ") + self.assertTrue(len(relay_descs) == 2) + + # check integrity and compliance of descriptors by parsing with + # validate flags on + server_desc = stem.descriptor.server_descriptor.ServerDescriptor(relay_descs[0], validate = True) + extra_info = stem.descriptor.extrainfo_descriptor.ExtraInfoDescriptor("extra-info " + relay_descs[1], validate = True) + + # check the contents of a few fields: as retrieved from controller; + # as compared between descriptors; as set by SETCONF; and as set by + # torrc + self.assertTrue(extra_info.nickname == server_desc.nickname == controller.get_conf("Nickname")) + self.assertEqual(server_desc.fingerprint, extra_info.fingerprint) + self.assertEqual(server_desc.address, "1.2.3.4") + self.assertEqual(1113, server_desc.or_port)
@test.require.controller def test_get_version(self):