diff options
author | Klement Sekera <klement.sekera@gmail.com> | 2022-04-26 19:02:15 +0200 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2022-05-10 18:52:08 +0000 |
commit | d9b0c6fbf7aa5bd9af84264105b39c82028a4a29 (patch) | |
tree | 4f786cfd8ebc2443cb11e11b74c8657204068898 /test/vpp_teib.py | |
parent | f90348bcb4afd0af2611cefc43b17ef3042b511c (diff) |
tests: replace pycodestyle with black
Drop pycodestyle for code style checking in favor of black. Black is
much faster, stable PEP8 compliant code style checker offering also
automatic formatting. It aims to be very stable and produce smallest
diffs. It's used by many small and big projects.
Running checkstyle with black takes a few seconds with a terse output.
Thus, test-checkstyle-diff is no longer necessary.
Expand scope of checkstyle to all python files in the repo, replacing
test-checkstyle with checkstyle-python.
Also, fixstyle-python is now available for automatic style formatting.
Note: python virtualenv has been consolidated in test/Makefile,
test/requirements*.txt which will eventually be moved to a central
location. This is required to simply the automated generation of
docker executor images in the CI.
Type: improvement
Change-Id: I022a326603485f58585e879ac0f697fceefbc9c8
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'test/vpp_teib.py')
-rw-r--r-- | test/vpp_teib.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/vpp_teib.py b/test/vpp_teib.py index ee2d89fe080..14688181582 100644 --- a/test/vpp_teib.py +++ b/test/vpp_teib.py @@ -9,14 +9,12 @@ from vpp_object import VppObject def find_teib(test, ne): ns = test.vapi.teib_dump() for n in ns: - if ne.peer == str(n.entry.peer) \ - and ne.itf._sw_if_index == n.entry.sw_if_index: + if ne.peer == str(n.entry.peer) and ne.itf._sw_if_index == n.entry.sw_if_index: return True return False class VppTeib(VppObject): - def __init__(self, test, itf, peer, nh, table_id=0): self._test = test self.table_id = table_id @@ -28,11 +26,12 @@ class VppTeib(VppObject): r = self._test.vapi.teib_entry_add_del( is_add=1, entry={ - 'nh_table_id': self.table_id, - 'sw_if_index': self.itf.sw_if_index, - 'peer': self.peer, - 'nh': self.nh, - }) + "nh_table_id": self.table_id, + "sw_if_index": self.itf.sw_if_index, + "peer": self.peer, + "nh": self.nh, + }, + ) self._test.registry.register(self, self._test.logger) return self @@ -40,13 +39,14 @@ class VppTeib(VppObject): r = self._test.vapi.teib_entry_add_del( is_add=0, entry={ - 'nh_table_id': self.table_id, - 'sw_if_index': self.itf.sw_if_index, - 'peer': self.peer, - }) + "nh_table_id": self.table_id, + "sw_if_index": self.itf.sw_if_index, + "peer": self.peer, + }, + ) def query_vpp_config(self): return find_teib(self._test, self) def object_id(self): - return ("teib-%s-%s" % (self.itf, self.peer)) + return "teib-%s-%s" % (self.itf, self.peer) |