mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2024-11-21 15:57:24 -06:00
replaceRootNote should be replaceRootNode
This commit is contained in:
parent
3e7c00272b
commit
afc44fde8e
@ -134,7 +134,7 @@ class NetworkGraph:
|
|||||||
node.parentId = self.exceptionCPEs[node.displayName]
|
node.parentId = self.exceptionCPEs[node.displayName]
|
||||||
self.nodes.append(node)
|
self.nodes.append(node)
|
||||||
|
|
||||||
def replaceRootNote(self, node: NetworkNode) -> None:
|
def replaceRootNode(self, node: NetworkNode) -> None:
|
||||||
# Replaces the automatically generated root node
|
# Replaces the automatically generated root node
|
||||||
# with a new node. Useful when you have a top-level
|
# with a new node. Useful when you have a top-level
|
||||||
# node specified (e.g. "uispSite" in the UISP
|
# node specified (e.g. "uispSite" in the UISP
|
||||||
|
@ -145,7 +145,7 @@ def buildFullGraph():
|
|||||||
# If this is the uispSite node, it becomes the root. Otherwise, add it to the
|
# If this is the uispSite node, it becomes the root. Otherwise, add it to the
|
||||||
# node soup.
|
# node soup.
|
||||||
if name == uispSite:
|
if name == uispSite:
|
||||||
net.replaceRootNote(node)
|
net.replaceRootNode(node)
|
||||||
else:
|
else:
|
||||||
net.addRawNode(node)
|
net.addRawNode(node)
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class TestGraph(unittest.TestCase):
|
|||||||
from integrationCommon import NetworkGraph, NetworkNode, NodeType
|
from integrationCommon import NetworkGraph, NetworkNode, NodeType
|
||||||
graph = NetworkGraph()
|
graph = NetworkGraph()
|
||||||
node = NetworkNode("Test", type = NodeType.site)
|
node = NetworkNode("Test", type = NodeType.site)
|
||||||
graph.replaceRootNote(node)
|
graph.replaceRootNode(node)
|
||||||
self.assertEqual(graph.nodes[0].id, "Test")
|
self.assertEqual(graph.nodes[0].id, "Test")
|
||||||
|
|
||||||
def add_child_by_named_parent(self):
|
def add_child_by_named_parent(self):
|
||||||
|
@ -135,7 +135,7 @@ class NetworkGraph:
|
|||||||
node.parentId = self.exceptionCPEs[node.displayName]
|
node.parentId = self.exceptionCPEs[node.displayName]
|
||||||
self.nodes.append(node)
|
self.nodes.append(node)
|
||||||
|
|
||||||
def replaceRootNote(self, node: NetworkNode) -> None:
|
def replaceRootNode(self, node: NetworkNode) -> None:
|
||||||
# Replaces the automatically generated root node
|
# Replaces the automatically generated root node
|
||||||
# with a new node. Useful when you have a top-level
|
# with a new node. Useful when you have a top-level
|
||||||
# node specified (e.g. "uispSite" in the UISP
|
# node specified (e.g. "uispSite" in the UISP
|
||||||
|
@ -176,7 +176,7 @@ def buildFullGraph():
|
|||||||
# If this is the uispSite node, it becomes the root. Otherwise, add it to the
|
# If this is the uispSite node, it becomes the root. Otherwise, add it to the
|
||||||
# node soup.
|
# node soup.
|
||||||
if name == uispSite:
|
if name == uispSite:
|
||||||
net.replaceRootNote(node)
|
net.replaceRootNode(node)
|
||||||
else:
|
else:
|
||||||
net.addRawNode(node)
|
net.addRawNode(node)
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class TestGraph(unittest.TestCase):
|
|||||||
from integrationCommon import NetworkGraph, NetworkNode, NodeType
|
from integrationCommon import NetworkGraph, NetworkNode, NodeType
|
||||||
graph = NetworkGraph()
|
graph = NetworkGraph()
|
||||||
node = NetworkNode("Test", type = NodeType.site)
|
node = NetworkNode("Test", type = NodeType.site)
|
||||||
graph.replaceRootNote(node)
|
graph.replaceRootNode(node)
|
||||||
self.assertEqual(graph.nodes[0].id, "Test")
|
self.assertEqual(graph.nodes[0].id, "Test")
|
||||||
|
|
||||||
def add_child_by_named_parent(self):
|
def add_child_by_named_parent(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user