Beispiel #1
0
def test_naming_shallow():
    root = String(name=u's')
    assert root.fq_name() == u'/'
    assert root.flattened_name() == u's'
    assert root.find_one(u'.') is root

    root = String(name=None)
    assert root.fq_name() == u'/'
    assert root.flattened_name() == u''
    assert root.find_one(u'.') is root
    assert root.find_one([u'/']) is root
Beispiel #2
0
def test_naming_shallow():
    root = String(name=u's')
    assert root.fq_name() == u'.'
    assert root.flattened_name() == u's'
    assert root.el(u'.') is root

    root = String(name=None)
    assert root.fq_name() == u'.'
    assert root.flattened_name() == u''
    assert root.el(u'.') is root
    assert_raises(LookupError, root.el, ())
    assert root.el([Root]) is root
Beispiel #3
0
def test_naming_shallow():
    root = String(name=u's')
    assert root.fq_name() == u'.'
    assert root.flattened_name() == u's'
    assert root.el(u'.') is root

    root = String(name=None)
    assert root.fq_name() == u'.'
    assert root.flattened_name() == u''
    assert root.el(u'.') is root
    assert_raises(LookupError, root.el, ())
    assert root.el([Root]) is root