Пример #1
0
 def test_remove_edge_no_attributes(self):
     adjud = RedundantEdgeAdjudicator()
     net = NiceCXNetwork()
     edgeid = net.create_edge(edge_source=0,
                              edge_target=1,
                              edge_interaction='foo')
     self.assertEqual('foo', net.get_edge(edgeid)['i'])
     adjud._remove_edge(net, edgeid)
     self.assertEqual(None, net.get_edge(edgeid))
Пример #2
0
 def test_remove_edge_with_attributes(self):
     adjud = RedundantEdgeAdjudicator()
     net = NiceCXNetwork()
     edgeid = net.create_edge(edge_source=0,
                              edge_target=1,
                              edge_interaction='foo')
     net.set_edge_attribute(edgeid, 'attr1', 'someval')
     self.assertEqual('someval',
                      net.get_edge_attribute(edgeid, 'attr1')['v'])
     self.assertEqual('foo', net.get_edge(edgeid)['i'])
     adjud._remove_edge(net, edgeid)
     self.assertEqual(None, net.get_edge(edgeid))
     self.assertEqual((None, None), net.get_edge_attribute(edgeid, 'attr1'))
Пример #3
0
 def test_remove_nonexistant_edge(self):
     adjud = RedundantEdgeAdjudicator()
     self.assertTrue('Removes' in adjud.get_description())
     net = NiceCXNetwork()
     adjud._remove_edge(net, 1)