mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 01:40:16 +00:00
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.
This commit is contained in:
parent
38c3993248
commit
240e334fca
0
tests/topotests/example-test/__init__.py
Normal file
0
tests/topotests/example-test/__init__.py
Normal file
@ -30,25 +30,20 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import pytest
|
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.
|
# Required to instantiate the topology builder class.
|
||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
|
|
||||||
# Save the Current Working Directory to find configuration files.
|
# Save the Current Working Directory to find configuration files.
|
||||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
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):
|
class TemplateTopo(Topo):
|
||||||
"Test topology builder"
|
"Test topology builder"
|
||||||
def build(self, *_args, **_opts):
|
def build(self, *_args, **_opts):
|
||||||
"Build function"
|
"Build function"
|
||||||
# pylint: disable=E1101
|
|
||||||
# Linter incorrectly detects tgen type as TemplateTopo.
|
|
||||||
tgen = get_topogen(self)
|
tgen = get_topogen(self)
|
||||||
|
|
||||||
# This function only purpose is to define allocation and relationship
|
# This function only purpose is to define allocation and relationship
|
||||||
|
Loading…
Reference in New Issue
Block a user