Пример #1
0
def test_iteration():
    vcard = reader(ios_v3_file)
    nodes = list(vcard)
    generated_ast = generate_ast(nodes)

    # Assert that we get the expected AST back
    assert generated_ast == ios_v3_ast
Пример #2
0
def test_org():
    vcard = reader(ios_v3_file)
    nodes = [vcard.organization()]
    assert has_nodes(vcard, nodes)
Пример #3
0
def test_name():
    vcard = reader(ios_v3_file)
    nodes = [vcard.name()]
    assert has_nodes(vcard, nodes)
Пример #4
0
def test_version():
    vcard = reader(ios_v3_file)
    nodes = [vcard.version()]
    assert has_nodes(vcard, nodes)
Пример #5
0
def test_emails():
    vcard = reader(ios_v3_file)
    nodes = list(vcard.emails())
    assert has_nodes(vcard, nodes)
Пример #6
0
def test_birthday():
    vcard = reader(ios_v3_file)
    nodes = [vcard.birthday()]
    assert has_nodes(vcard, nodes)
Пример #7
0
def test_addresses():
    vcard = reader(ios_v3_file)
    nodes = list(vcard.addresses())
    assert has_nodes(vcard, nodes)
Пример #8
0
def test_indexing():
    vcard = reader(ios_v3_file)
    node = vcard[5]
    with open(fixture_path_for("reggie-smalls-ios-v3.0.ast")) as f:
        assert repr(node) == f.readlines()[5].strip()
Пример #9
0
def test_phones():
    vcard = reader(ios_v3_file)
    nodes = list(vcard.phones())
    assert has_nodes(vcard, nodes)
Пример #10
0
def test_prodid():
    vcard = reader(ios_v3_file)
    nodes = [vcard.prodid()]
    assert has_nodes(vcard, nodes)