示例#1
0
def test_expand():
    doc = XML("<doc><hello>world</hello></doc>", fragment=False)
    assert type(doc) is ElementStream
    doc = doc.expand()
    assert type(doc) == type(Element('doc'))
    assert doc.tag == 'doc'
    assert doc[0].tag == 'hello'
    assert doc[0].text == 'world'
示例#2
0
def test_expand():
    doc = XML("<doc><hello>world</hello></doc>", fragment=False)
    assert type(doc) is ElementStream
    doc = doc.expand()
    assert type(doc) == type(Element('doc'))
    assert doc.tag == 'doc'
    assert doc[0].tag == 'hello'
    assert doc[0].text == 'world'