[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_cli.py b/lib/xos-genx/xos-genx-tests/test_cli.py
index 4beef06..3f94865 100644
--- a/lib/xos-genx/xos-genx-tests/test_cli.py
+++ b/lib/xos-genx/xos-genx-tests/test_cli.py
@@ -1,4 +1,3 @@
-
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,33 +18,39 @@
from mock import patch
from xosgenx.xosgen import XosGen
+
class Args:
pass
+
class XOSProcessorTest(unittest.TestCase):
"""
Testing the CLI binding for the XOS Generative Toolchain
"""
def setUp(self):
- os.chdir(os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))), ".."))
+ os.chdir(
+ os.path.join(
+ os.path.abspath(os.path.dirname(os.path.realpath(__file__))), ".."
+ )
+ )
def test_generator(self):
"""
[XOS-GenX] The CLI entry point should correctly parse params
"""
args = Args()
- args.files = ['xos-genx-tests/xproto/test.xproto']
- args.target = 'xos-genx-tests/xtarget/test.xtarget'
- args.output = 'xos-genx-tests/out/dir/'
+ args.files = ["xos-genx-tests/xproto/test.xproto"]
+ args.target = "xos-genx-tests/xtarget/test.xtarget"
+ args.output = "xos-genx-tests/out/dir/"
args.write_to_file = "target"
args.dest_file = None
args.dest_extension = None
expected_args = Args()
- expected_args.files = [os.path.abspath(os.getcwd() + '/' + args.files[0])]
- expected_args.target = os.path.abspath(os.getcwd() + '/' + args.target)
- expected_args.output = os.path.abspath(os.getcwd() + '/' + args.output)
+ expected_args.files = [os.path.abspath(os.getcwd() + "/" + args.files[0])]
+ expected_args.target = os.path.abspath(os.getcwd() + "/" + args.target)
+ expected_args.output = os.path.abspath(os.getcwd() + "/" + args.output)
with patch("xosgenx.xosgen.XOSProcessor.process") as generator:
XosGen.init(args)
@@ -53,5 +58,6 @@
self.assertEqual(actual_args.files, expected_args.files)
self.assertEqual(actual_args.output, expected_args.output)
-if __name__ == '__main__':
+
+if __name__ == "__main__":
unittest.main()