def test_entity_set(): eset = EntitySet('eset1', {'A', 'C', 'K'}) eset2 = eset.clone('eset2') assert eset.elements == eset2.elements assert len(eset) == 3 assert eset.uid == 'eset1' assert len(eset.children) == 0 with pytest.raises(HyperNetXError) as excinfo: eset2.add(Entity('Z',['A','C','B'])) assert 'Fails the bipartite condition' in str(excinfo.value)
def test_entity_set(): eset = EntitySet("eset1", {"A", "C", "K"}) eset2 = eset.clone("eset2") assert eset.elements == eset2.elements assert len(eset) == 3 assert eset.uid == "eset1" assert len(eset.children) == 0 with pytest.raises(HyperNetXError) as excinfo: eset2.add(Entity("Z", ["A", "C", "B"])) assert "Fails the bipartite condition" in str(excinfo.value)