]> git.proxmox.com Git - mirror_frr.git/blobdiff - tests/topotests/example_topojson_test/test_topo_json_single_link/test_example_topojson.py
tests: cleanup: rerun changed files through black
[mirror_frr.git] / tests / topotests / example_topojson_test / test_topo_json_single_link / test_example_topojson.py
index 26336d5de1eace20a04de6aceaf95198cc640b90..b03215d21c9345ddc988e3d4b4dcd0eded944bfd 100755 (executable)
@@ -39,7 +39,6 @@ sys.path.append(os.path.join(CWD, "../../"))
 from lib.topogen import Topogen, get_topogen
 
 # Required to instantiate the topology builder class.
-from mininet.topo import Topo
 
 # Import topoJson from lib, to create topology and initial configuration
 from lib.common_config import (
@@ -79,27 +78,19 @@ bgp_convergence = False
 input_dict = {}
 
 
-class TemplateTopo(Topo):
-    """
-    Test topology builder
-
-    * `Topo`: Topology object
-    """
-
-    def build(self, *_args, **_opts):
-        "Build function"
-        tgen = get_topogen(self)
+def build_topo(tgen):
+    "Build function"
 
-        # This function only purpose is to create topology
-        # as defined in input json file.
-        #
-        # Example
-        #
-        # Creating 2 routers having single links in between,
-        # which is used to establised BGP neighborship
+    # This function only purpose is to create topology
+    # as defined in input json file.
+    #
+    # Example
+    #
+    # Creating 2 routers having single links in between,
+    # which is used to establised BGP neighborship
 
-        # Building topology from json file
-        build_topo_from_json(tgen, topo)
+    # Building topology from json file
+    build_topo_from_json(tgen, topo)
 
 
 def setup_module(mod):
@@ -116,7 +107,7 @@ def setup_module(mod):
     logger.info("Running setup_module to create topology")
 
     # This function initiates the topology build with Topogen...
-    tgen = Topogen(TemplateTopo, mod.__name__)
+    tgen = Topogen(build_topo, mod.__name__)
     # ... and here it calls Mininet initialization functions.
 
     # Starting topology, create tmp files which are loaded to routers
@@ -154,7 +145,7 @@ def teardown_module(mod):
 
 
 def test_bgp_convergence(request):
-    " Test BGP daemon convergence "
+    "Test BGP daemon convergence"
 
     tgen = get_topogen()
     global bgp_convergence
@@ -177,7 +168,7 @@ def test_bgp_convergence(request):
 
 
 def test_static_routes(request):
-    " Test to create and verify static routes. "
+    "Test to create and verify static routes."
 
     tgen = get_topogen()
     if bgp_convergence is not True: