''' Assert that all connections in the connections list exists in the cfg,
as well as all connections not in the list do not exist
connections is a list of tuples where the node at index 0 of the tuple has to be in the new_constraintset of the node a index 1 of the tuple'''
forconnectioninconnections:
self.assertEqual(lattice.in_constraint(self.cfg.nodes[connection[0]], self.cfg.nodes[connection[1]]), True, str(connection) +" expected to be connected")
nodes=len(self.cfg.nodes)
forelementinrange(nodes):
forsetsinrange(nodes):
if (element, sets) notinconnections:
self.assertEqual(lattice.in_constraint(self.cfg.nodes[element], self.cfg.nodes[sets]), False, "(%s,%s)"% (self.cfg.nodes[element], self.cfg.nodes[sets]) +" expected to be disconnected")