Beispiel #1
0
def test_repair_do_nothing():
    item = Item('BEGIN:VCARD\nUID:justfine\nEND:VCARD')
    assert repair_item('fine', item, set(), True) is item
    assert repair_item('@@@@/fine', item, set(), True) is item
Beispiel #2
0
def test_repair_irreparable(raw):
    with pytest.raises(IrreparableItem):
        repair_item('fine', Item(raw), set(), True)
Beispiel #3
0
def test_repair_unsafe_href(uid, href):
    item = Item('BEGIN:VCARD\nUID:{}\nEND:VCARD'.format(uid))
    new_item = repair_item(href, item, set(), True)
    assert new_item.raw != item.raw
    assert new_item.uid != item.uid
    assert href_safe(new_item.uid)
Beispiel #4
0
def test_repair_irreparable(raw):
    with pytest.raises(IrreparableItem):
        repair_item('fine', Item(raw), set(), True)
Beispiel #5
0
def test_repair_do_nothing():
    item = Item('BEGIN:VCARD\nUID:justfine\nEND:VCARD')
    assert repair_item('fine', item, set(), True) is item
    assert repair_item('@@@@/fine', item, set(), True) is item
Beispiel #6
0
def test_repair_unsafe_href(uid, href):
    item = Item('BEGIN:VCARD\nUID:{}\nEND:VCARD'.format(uid))
    new_item = repair_item(href, item, set(), True)
    assert new_item.raw != item.raw
    assert new_item.uid != item.uid
    assert href_safe(new_item.uid)
Beispiel #7
0
def test_repair_do_nothing():
    item = Item("BEGIN:VCARD\nUID:justfine\nEND:VCARD")
    assert repair_item("fine", item, set(), True) is item
    assert repair_item("@@@@/fine", item, set(), True) is item