def test_is_to_delete_field_substring():
    path = 'figures'
    conflict_list = [('SET_FIELD', ('figures', 0, 'key'), 'figure1.png'),
                     ('SET_FIELD', ('figures_attached', 0, 'key'),
                      'figure2.png')]
    assert is_to_delete(conflict_list[0], path) is True
    assert is_to_delete(conflict_list[1], path) is False
def test_is_to_delete_wrong_path():
    c = Conflict('SET_FIELD', ('figures', 0, 'key'), 'figure1.png')
    to_delete = 'figures.keys'
    assert is_to_delete(c, to_delete) is False
def test_is_to_delete_false():
    c = Conflict('SET_FIELD', ('figures', 0, 'key'), 'figure1.png')
    to_delete = 'authors'
    assert is_to_delete(c, to_delete) is False
def test_is_to_delete_true_longer_path():
    c = Conflict('SET_FIELD', ('figures', 0, 'key'), 'figure1.png')
    to_delete = 'figures.key'
    assert is_to_delete(c, to_delete) is True
def test_is_to_delete_manual_merge():
    c = Conflict('MANUAL_MERGE', ('figures', 0, 'key'), 'figure1.png')
    to_delete = 'figures'
    assert is_to_delete(c, to_delete) is False