def testBasicSetIndex(self): """ Test that indices are correct relative to each other, using very basic network structure """ self.graph = Graph.DAG(self.nodes) assert(self.nodes[0].index > self.nodes[4].index and \ self.nodes[1].index > self.nodes[0].index and \ self.nodes[1].index > self.nodes[3].index and \ self.nodes[2].index > self.nodes[0].index), \ "Indexes were not set properly in DAG.topological_sort()"
def testAllIndexSet(self): """ Test that all indices are >= 0 """ self.graph = Graph.DAG(self.nodes) for node in self.nodes: assert (node.index >= 0), "Index was less than 0"