Skip to content

Commit

Permalink
Agregué una prueba para ver si la arista fue eliminada
Browse files Browse the repository at this point in the history
  • Loading branch information
renich committed Oct 19, 2012
1 parent b27c47d commit 87cc7ea
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions test_Graph.py
Expand Up @@ -3,23 +3,26 @@

class GraphTest(unittest.TestCase):

def setUp(self):
self.v = Vertex('v')
self.w = Vertex('w')
self.x = Vertex('x')
self.y = Vertex('y')
self.z = Vertex('z')
self.e = Edge(self.v, self.w)
self.e2 = Edge(self.v, self.x)
self.g = Graph([self.v, self.w ,self.x, self.y],[self.e, self.e2])
def setUp(self):
self.v = Vertex('v')
self.w = Vertex('w')
self.x = Vertex('x')
self.y = Vertex('y')
self.z = Vertex('z')
self.e = Edge(self.v, self.w)
self.e2 = Edge(self.v, self.x)
self.g = Graph([self.v, self.w ,self.x, self.y],[self.e, self.e2])

def test_get_edge_not_exist(self):
edge = self.g.get_edge(self.v, self.y)
self.assertIsNone(edge)
def test_remove_edge_is_removed( self ):
'''
La prueba checa si el Edge esta por ahi.
Depende de la funcion de get_edge
'''
edge = self.g.remove_edge( self.e )
self.assertIsNone( self.g.get_edge( self.v, self.w ) )

if __name__ == '__main__':
suite = unittest.TestSuite()
unittest.TextTestRunner(verbosity = 2).run(suite)
unittest.main()


0 comments on commit 87cc7ea

Please sign in to comment.