Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
acezen committed Apr 27, 2021
1 parent 0aabf37 commit d24dafb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/graphscope/experimental/nx/tests/classes/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,20 @@ def test_selfloops(self):
G.add_edge(2, 2)
assert G.number_of_edges() == 3
assert G.number_of_selfloops() == 2

SG = G.subgraph([0, 1])
assert SG.number_of_edges() == 2
assert SG.number_of_selfloops() == 1
ESG = G.edge_subgraph([(0, 0), (2, 2)])
assert ESG.number_of_edges() == 2
assert ESG.number_of_selfloops() == 1

assert ESG.number_of_selfloops() == 2
H = G.copy()
assert H.number_of_selfloops() == 2
Gv = G.copy(as_view=True)
assert H.number_of_selfloops() == 2
assert Gv.number_of_selfloops() == 2
G.remove_node(0)
assert G.number_of_selfloops() == 1
G.remove_edge(2, 2)
assert G.number_of_selfloops() == 0


@pytest.mark.usefixtures("graphscope_session")
Expand Down

0 comments on commit d24dafb

Please sign in to comment.