[style] apply google python style guide (#4501)

This commit applies and enforces Google's python style for tests.
This commit is contained in:
Yakun Xu
2020-02-04 10:27:50 -08:00
committed by GitHub
parent 8368d440dd
commit 33808ebfba
501 changed files with 6674 additions and 5515 deletions
@@ -42,6 +42,7 @@ ROUTER_SELECTION_JITTER = 1
class Cert_5_2_5_AddressQuery(unittest.TestCase):
def setUp(self):
self.simulator = config.create_default_simulator()
@@ -126,9 +127,7 @@ class Cert_5_2_5_AddressQuery(unittest.TestCase):
# 6. Verify DUT_REED would send Address Notification when ping to its
# ML-EID.
mleid = self.nodes[DUT_REED].get_ip6_address(
config.ADDRESS_TYPE.ML_EID
)
mleid = self.nodes[DUT_REED].get_ip6_address(config.ADDRESS_TYPE.ML_EID)
self.assertTrue(self.nodes[ED1].ping(mleid))
# Wait for sniffer collecting packets
@@ -136,17 +135,15 @@ class Cert_5_2_5_AddressQuery(unittest.TestCase):
reed_messages = self.simulator.get_messages_sent_by(DUT_REED)
msg = reed_messages.next_coap_message('0.02', '/a/an')
command.check_address_notification(
msg, self.nodes[DUT_REED], self.nodes[LEADER]
)
command.check_address_notification(msg, self.nodes[DUT_REED],
self.nodes[LEADER])
# 7 & 8. Verify DUT_REED would send Address Notification when ping to
# its 2001::EID and 2002::EID.
flag2001 = 0
flag2002 = 0
for global_address in self.nodes[DUT_REED].get_ip6_address(
config.ADDRESS_TYPE.GLOBAL
):
config.ADDRESS_TYPE.GLOBAL):
if global_address[0:4] == '2001':
flag2001 += 1
elif global_address[0:4] == '2002':
@@ -160,9 +157,8 @@ class Cert_5_2_5_AddressQuery(unittest.TestCase):
reed_messages = self.simulator.get_messages_sent_by(DUT_REED)
msg = reed_messages.next_coap_message('0.02', '/a/an')
command.check_address_notification(
msg, self.nodes[DUT_REED], self.nodes[LEADER]
)
command.check_address_notification(msg, self.nodes[DUT_REED],
self.nodes[LEADER])
assert flag2001 == 1, "Error: Expecting address 2001::EID not appear."
assert flag2002 == 1, "Error: Expecting address 2002::EID not appear."