Skip to content

Commit

Permalink
added test for containment validating bool and len of undirected graph
Browse files Browse the repository at this point in the history
  • Loading branch information
eileen-kuehn committed Jul 27, 2018
1 parent 155f682 commit dd98fd0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions graphi_unittests/types_unittests/test_undirected.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ def test_edges(self):
self.assertNotEqual(last_edge, edge)
last_edge = edge
self.assertFalse(last_edge == [1])

def test_containment(self):
graph = self.graph_cls()
self.assertFalse(bool(graph), "Graph is expected to be false as no nodes/edges are contained")
self.assertEquals(len(graph), 0)
graph.add(1)
graph.add(2)
graph[1:2] = 1
self.assertTrue(bool(graph))
self.assertEquals(len(graph), 2)

0 comments on commit dd98fd0

Please sign in to comment.