diff options
| author | Rafael Zalamena <rzalamena@gmail.com> | 2017-06-22 17:01:58 -0300 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-11-27 20:22:11 -0500 |
| commit | 240e334fca888265af02d8e0930623b15d13c991 (patch) | |
| tree | 06ba6a2977d9ff65baecdf5a42630ec6e0976cbc | |
| parent | 38c3993248ac22e4a85758038cb1f3c5d3f725d4 (diff) | |
example: add missing __init__.py
Adding the __init__.py file makes python and its linter recognize that
the test makes part of the package, this makes us save a few lines of
code to make the linter and auto complete engines happy.
| -rw-r--r-- | tests/topotests/example-test/__init__.py | 0 | ||||
| -rw-r--r-- | tests/topotests/example-test/test_template.py | 13 |
2 files changed, 4 insertions, 9 deletions
diff --git a/tests/topotests/example-test/__init__.py b/tests/topotests/example-test/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/topotests/example-test/__init__.py diff --git a/tests/topotests/example-test/test_template.py b/tests/topotests/example-test/test_template.py index 53a4f444cc..d5d3b7afb3 100644 --- a/tests/topotests/example-test/test_template.py +++ b/tests/topotests/example-test/test_template.py @@ -30,25 +30,20 @@ import os import sys import pytest +# Import topogen and topotest helpers +from lib import topotest +from lib.topogen import Topogen, TopoRouter, get_topogen + # Required to instantiate the topology builder class. from mininet.topo import Topo # Save the Current Working Directory to find configuration files. CWD = os.path.dirname(os.path.realpath(__file__)) -# Append to the search path the lib location -sys.path.append(os.path.join(CWD, '..')) - -# pylint: disable=C0413 -# Import topogen and topotest helpers -from lib import topotest -from lib.topogen import Topogen, TopoRouter, get_topogen class TemplateTopo(Topo): "Test topology builder" def build(self, *_args, **_opts): "Build function" - # pylint: disable=E1101 - # Linter incorrectly detects tgen type as TemplateTopo. tgen = get_topogen(self) # This function only purpose is to define allocation and relationship |
