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
def test_org(): vcard = reader(ios_v3_file) nodes = [vcard.organization()] assert has_nodes(vcard, nodes)
def test_name(): vcard = reader(ios_v3_file) nodes = [vcard.name()] assert has_nodes(vcard, nodes)
def test_version(): vcard = reader(ios_v3_file) nodes = [vcard.version()] assert has_nodes(vcard, nodes)
def test_emails(): vcard = reader(ios_v3_file) nodes = list(vcard.emails()) assert has_nodes(vcard, nodes)
def test_birthday(): vcard = reader(ios_v3_file) nodes = [vcard.birthday()] assert has_nodes(vcard, nodes)
def test_addresses(): vcard = reader(ios_v3_file) nodes = list(vcard.addresses()) assert has_nodes(vcard, nodes)
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()
def test_phones(): vcard = reader(ios_v3_file) nodes = list(vcard.phones()) assert has_nodes(vcard, nodes)
def test_prodid(): vcard = reader(ios_v3_file) nodes = [vcard.prodid()] assert has_nodes(vcard, nodes)