def test_care_when_assumed_merge(tmpdir):
    f = tmpdir.join('README.md')
    f.write_binary(b'problem\n=======\n')
    assert detect_merge_conflict([str(f.realpath()), '--assume-in-merge']) == 1
def test_ignores_binary_files():
    shutil.copy(get_resource_path('img1.jpg'), 'f1')
    assert detect_merge_conflict(['f1']) == 0
def test_does_not_care_when_not_in_a_merge(tmpdir):
    f = tmpdir.join('README.md')
    f.write_binary(b'problem\n=======\n')
    assert detect_merge_conflict([str(f.realpath())]) == 0
def test_merge_conflicts_failing(contents, repository_pending_merge):
    repository_pending_merge.join('f2').write_binary(contents)
    assert detect_merge_conflict(['f2']) == 1
def test_merge_conflicts_ok(contents, f1_is_a_conflict_file):
    f1_is_a_conflict_file.join('f1').write_binary(contents)
    assert detect_merge_conflict(['f1']) == 0
Esempio n. 6
0
def test_does_not_care_when_not_in_a_merge(tmpdir):
    tmpdir.join('README.md').write('problem\n=======\n')
    assert detect_merge_conflict(['README.md']) == 0
def test_merge_conflicts_git():
    assert detect_merge_conflict(['f1']) == 1
Esempio n. 8
0
def test_merge_conflicts_failing(failing_contents):
    write_file('f2', failing_contents)
    assert detect_merge_conflict(['f2']) == 1
Esempio n. 9
0
def test_merge_conflicts_ok(ok_contents):
    write_file('f1', ok_contents)
    assert detect_merge_conflict(['f1']) == 0
def test_merge_conflicts_git():
    assert detect_merge_conflict(['f1']) == 1
def test_does_not_care_when_not_in_a_merge():
    with io.open('README.md', 'w') as readme_file:
        readme_file.write('problem\n=======\n')
    assert detect_merge_conflict(['README.md']) == 0
def test_does_not_care_when_not_in_a_merge(tmpdir):
    tmpdir.join('README.md').write('problem\n=======\n')
    assert detect_merge_conflict(['README.md']) == 0
def test_ignores_binary_files():
    shutil.copy(get_resource_path('img1.jpg'), 'f1')
    assert detect_merge_conflict(['f1']) == 0
def test_merge_conflicts_ok(ok_contents):
    write_file('f1', ok_contents)
    assert detect_merge_conflict(['f1']) == 0
def test_merge_conflicts_failing(failing_contents):
    write_file('f2', failing_contents)
    assert detect_merge_conflict(['f2']) == 1
def test_does_not_care_when_not_in_a_merge():
    with io.open('README.md', 'w') as readme_file:
        readme_file.write('problem\n=======\n')
    assert detect_merge_conflict(['README.md']) == 0