Exemplo n.º 1
0
def test_simple_labeled_node():
    node = Node('Node')
    assert node.labels == ('Node',)
    # cannot reset label once created
    with pytest.raises(AttributeError):
        node.labels = ('bob',)
    assert not node.schema
Exemplo n.º 2
0
def test_node_set_once():
    node = Node('x')
    with pytest.raises(ImmutableAttributeError):
        node.labels = list('abc')
    with pytest.raises(ImmutableAttributeError):
        node.type = 'y'
    with pytest.raises(ImmutableAttributeError):
        del node.labels
    with pytest.raises(ImmutableAttributeError):
        del node.type