Ejemplo n.º 1
0
 def test_wireToVertices(self):
   obj = self.ofactory.getNewObject(8, True)
   val = self.vfactory.getNewValue()
   
   edge = SMGHVEdge(0, 0, obj, val)
   edge.wireToVertices()
   
   hvedges_from_object = obj.getHVEdges()
   hvedges_to_value = val.getHVEdges()
   
   self.assertEqual(len(hvedges_from_object), 1)
   self.assertIn(edge, hvedges_from_object)
   self.assertEqual(len(hvedges_to_value), 1)
   self.assertIn(edge, hvedges_to_value)
Ejemplo n.º 2
0
 def test_constructor(self):
   obj = self.ofactory.getNewObject(8, True)
   val = self.vfactory.getNewValue()
   
   edge = SMGHVEdge(0, 0, obj, val)
   
   self.assertIs(obj, edge.getObject())
   self.assertIs(val, edge.getValue())
   self.assertEqual(0, edge.getOffset())
   self.assertEqual(0, edge.getDataType())
   
   hvedges_from_object = obj.getHVEdges()
   hvedges_to_value = val.getHVEdges()
   
   self.assertEqual(len(hvedges_from_object), 0)
   self.assertEqual(len(hvedges_to_value), 0)
Ejemplo n.º 3
0
 def addHVEdge(self, offset, datatype, smg_object, value):
   edge = SMGHVEdge(offset, datatype, smg_object, value)
   edge.wireToVertices()
   return edge