[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
+16 -17
View File
@@ -51,8 +51,9 @@ def any_ipv6_address():
class TestMessageInfo(unittest.TestCase):
def test_should_return_source_ipv6_value_when_source_ipv6_property_is_called(
self):
self):
# GIVEN
source_ipv6 = any_ipv6_address()
@@ -63,12 +64,11 @@ class TestMessageInfo(unittest.TestCase):
actual_source_ipv6 = message_info.source_ipv6
# THEN
self.assertEqual(
ipaddress.ip_address(bytes(source_ipv6)), actual_source_ipv6
)
self.assertEqual(ipaddress.ip_address(bytes(source_ipv6)),
actual_source_ipv6)
def test_should_return_destination_ipv6_value_when_destination_ipv6_property_is_called(
self):
self):
# GIVEN
destination_ipv6 = any_ipv6_address()
@@ -85,7 +85,7 @@ class TestMessageInfo(unittest.TestCase):
)
def test_should_return_source_eui64_value_when_source_eui64_property_is_called(
self):
self):
# GIVEN
source_mac_address = any_eui64()
@@ -99,7 +99,7 @@ class TestMessageInfo(unittest.TestCase):
self.assertEqual(source_mac_address, actual_source_mac_address)
def test_should_return_destination_eui64_value_when_destination_eui64_property_is_called(
self):
self):
# GIVEN
destination_mac_address = any_eui64()
@@ -110,14 +110,14 @@ class TestMessageInfo(unittest.TestCase):
actual_destination_mac_address = message_info.destination_mac_address
# THEN
self.assertEqual(
destination_mac_address, actual_destination_mac_address
)
self.assertEqual(destination_mac_address,
actual_destination_mac_address)
class TestMacAddress(unittest.TestCase):
def test_should_create_MacAddress_from_eui64_when_from_eui64_classmethod_is_called(
self):
self):
# GIVEN
eui64 = any_eui64()
@@ -129,7 +129,7 @@ class TestMacAddress(unittest.TestCase):
self.assertEqual(eui64, mac_address.mac_address)
def test_should_create_MacAddress_from_rloc16_int_when_from_rloc16_classmethod_is_called(
self):
self):
# GIVEN
rloc16 = any_rloc16_int()
@@ -141,7 +141,7 @@ class TestMacAddress(unittest.TestCase):
self.assertEqual(struct.pack(">H", rloc16), mac_address.mac_address)
def test_should_create_MacAddress_from_rloc16_bytearray_when_from_rloc16_classmethod_is_called(
self):
self):
# GIVEN
rloc16 = any_rloc16_bytearray()
@@ -153,7 +153,7 @@ class TestMacAddress(unittest.TestCase):
self.assertEqual(rloc16, mac_address.mac_address)
def test_should_convert_short_MacAddress_to_iid_when_convert_method_is_called(
self):
self):
# GIVEN
rloc16 = any_rloc16_bytearray()
@@ -164,11 +164,10 @@ class TestMacAddress(unittest.TestCase):
# THEN
self.assertEqual(
bytearray([0x00, 0x00, 0x00, 0xff, 0xfe, 0x00]) + rloc16, iid
)
bytearray([0x00, 0x00, 0x00, 0xff, 0xfe, 0x00]) + rloc16, iid)
def test_should_convert_eui64_MacAddress_to_iid_when_convert_method_is_called(
self):
self):
# GIVEN
eui64 = any_eui64()