예제 #1
0
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)
예제 #2
0
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)