MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / test_remove_group

Function test_remove_group

easygraph/classes/tests/test_hypergraph.py:276–298  ·  view source on GitHub ↗
(g1)

Source from the content-addressed store, hash-verified

274
275
276def test_remove_group(g1):
277 origin_e = deepcopy(g1.e[0])
278
279 g1.add_hyperedges(([0, 1, 2, 5], [0, 1]), group_name="test")
280 for e in origin_e:
281 assert e in g1.e_of_group("main")[0]
282 for e in g1.e_of_group("main")[0]:
283 assert e in origin_e
284
285 g1.remove_group("none")
286
287 g1.remove_group("test")
288 assert "test" not in g1.group_names
289
290 for e in origin_e:
291 assert e in g1.e_of_group("main")[0]
292 for e in g1.e_of_group("main")[0]:
293 assert e in origin_e
294
295 g1.remove_group("main")
296
297 assert len(g1.e[0]) == 0
298 assert len(g1.e[1]) == 0
299
300
301def test_add_and_remove_group(g1):

Callers

nothing calls this directly

Calls 3

remove_groupMethod · 0.80
add_hyperedgesMethod · 0.45
e_of_groupMethod · 0.45

Tested by

no test coverage detected