def test_color_graph(self):
     g, sim_nodes = createRandomTree(50)
     
     six2three_inst = Six2three(g, sim_nodes)
     
     six2three_inst.color_graph()
     
     for node in sim_nodes:
         self.failIf(node.memory['color'] >= 3)
         
     from visualizations import saveColoredGraph
     saveColoredGraph(g, sim_nodes, '/home/julka/testowe2')
 def test_color_graph(self):
     g, sim_nodes = createRandomTree(500)
     
     c6instance = Color6(g, sim_nodes)
     c6instance.color_graph()
     
     
     # tak dodatkowo...
     from visualizations import saveColoredGraph
     saveColoredGraph(g, sim_nodes, '/home/julka/testowe')
     
     for node in sim_nodes:
         self.failUnless(node.memory['color'] <= 5)
 def test_update_outbox(self):
     g, sim_nodes = createRandomTree(5)
     
     c6instance = Color6(g, sim_nodes)
     root_node = sim_nodes[0]
     
     root_color = 15
     root_node.memory['color'] = root_color
     root_vertex = g.vertex(0)
     
     root_children_ids = get_children_ids(root_vertex, 0)
     
     c6instance._update_outbox(root_node)
     
     self.failUnless(len(root_children_ids) == len(root_node.outbox))
     
     for msg in root_node.outbox:
         self.failUnless(msg.source_id == 0)
         self.failUnless(msg.target_id in root_children_ids)
         self.failUnless(msg.data == root_color)