예제 #1
0
def test_delete_conflicts_longer_path():
    conflicts = [
        ('SET_FIELD', ('figures', 0, 'key'), 'figure1.png'),
        ('SET_FIELD', ('figures', 1, 'key'), 'figure2.png'),
        ('SET_FIELD', ('authors', 1, 'full_name', 0, 'foo'), 'John Smith')
    ]
    assert len(filter_conflicts_by_path(conflicts, 'authors.full_name')) is 2
예제 #2
0
def test_delete_conflict_with_path_prefix():
    conflict_list = [
        ('SET_FIELD', ('authors', 0, 'full_name'), 'John Ellis'),
        ('SET_FIELD', ('figures', 1, 'key'), 'figure.png')
    ]
    conflict_list = filter_conflicts_by_path(conflict_list, 'authors')
    assert conflict_list == [('SET_FIELD', ('figures', 1, 'key'), 'figure.png')]
def test_delete_conflicts_more_deletion():
    conflicts = [('SET_FIELD', ('figures', 0, 'key'), 'figure1.png'),
                 ('SET_FIELD', ('figures', 1, 'key'), 'figure2.png'),
                 ('SET_FIELD', ('authors', 1, 'full_name'), 'John Smith')]
    assert len(filter_conflicts_by_path(conflicts, 'figures')) == 1