[SEBA-412] Automated reformat of Python code
Passes of modernize, autopep8, black, then check with flake8
flake8 + manual fixes:
lib/xos-config
lib/xos-kafka
lib/xos-util
xos/coreapi
xos/api
xos/xos_client
Change-Id: Ib23cf84cb13beb3c6381fa0d79594dc9131dc815
diff --git a/lib/xos-genx/xos-genx-tests/test_parse.py b/lib/xos-genx/xos-genx-tests/test_parse.py
index d7edcb7..8d1ccf5 100644
--- a/lib/xos-genx/xos-genx-tests/test_parse.py
+++ b/lib/xos-genx/xos-genx-tests/test_parse.py
@@ -1,4 +1,3 @@
-
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,13 +17,13 @@
from xosgenx.generator import XOSProcessor, XOSProcessorArgs
from helpers import XProtoTestHelpers
+
class XProtoParseTests(unittest.TestCase):
def test_global_options(self):
xtarget = XProtoTestHelpers.write_tmp_target("{{ options }}")
- xproto = \
-"""
+ xproto = """
option kind = "vsg";
option verbose_name = "vSG Service";
"""
@@ -38,8 +37,7 @@
def test_basic_proto(self):
xtarget = XProtoTestHelpers.write_tmp_target("{{ proto }}")
- xproto = \
-"""
+ xproto = """
message Person {
required string name = 1;
required int32 id = 2; // Unique ID number for this person.
@@ -66,8 +64,7 @@
def test_link_extensions(self):
xtarget = XProtoTestHelpers.write_tmp_target("{{ proto.messages.0.links }}")
- xproto = \
-"""
+ xproto = """
message links {
required manytoone vrouter_service->VRouterService:device_ports = 4 [db_index = True, null = False, blank = False];
}
@@ -79,9 +76,10 @@
self.assertIn("VRouterService", output)
def test_through_extensions(self):
- xtarget = XProtoTestHelpers.write_tmp_target("{{ proto.messages.0.links.0.through }}")
- xproto = \
-"""
+ xtarget = XProtoTestHelpers.write_tmp_target(
+ "{{ proto.messages.0.links.0.through }}"
+ )
+ xproto = """
message links {
required manytomany vrouter_service->VRouterService/ServiceProxy:device_ports = 4 [db_index = True, null = False, blank = False];
}
@@ -93,9 +91,10 @@
self.assertIn("ServiceProxy", output)
def test_message_options(self):
- xtarget = XProtoTestHelpers.write_tmp_target("{{ proto.messages.0.options.type }}")
- xproto = \
-"""
+ xtarget = XProtoTestHelpers.write_tmp_target(
+ "{{ proto.messages.0.options.type }}"
+ )
+ xproto = """
message link {
option type = "e1000";
}
@@ -108,8 +107,7 @@
def test_message_base(self):
xtarget = XProtoTestHelpers.write_tmp_target("{{ proto.messages.0.bases }}")
- xproto = \
-"""
+ xproto = """
message base(Base) {
}
"""
@@ -120,7 +118,6 @@
output = XOSProcessor.process(args)
self.assertIn("Base", output)
-if __name__ == '__main__':
+
+if __name__ == "__main__":
unittest.main()
-
-