def addNoEdge_test(): G = Graph() G.add_nodes_from(Friends) G.add_edges_from(Relationships) exp = G.edges() # remove an edge but give an empty list G.remove_edge([]) obs = G.edges() assert_equal(exp, obs)
def removePartEdge_test(): G = Graph() G.add_nodes_from(Friends) G.add_edges_from(Relationships) exp = G.edges() # remove an edge but give a single part of the edge G.remove_edge(['Alex']) obs = G.edges() assert_equal(exp, obs)
def emptyEdges_test(): G = Graph() G.add_nodes_from(Friends) G.add_edges_from(Relationships) # test "edges" when given a string and not a list of strings obs = G.edges('Alex') exp = [['Alex', 'Julie'], ['Alex', 'Michael'], ['Alex', 'Ved']] assert_equal(exp, obs)
def removeEdgeMorethan2_test(): G = Graph() G.add_nodes_from(Friends) G.add_edges_from(Relationships) # remove an edge but give three entries G.remove_edge(['Alex', 'Julie', 'Michael']) exp = 21 obs = len(G.edges()) assert_equal(exp, obs)