Refactor check-merge-conflicts tests

Do a straight test of detecting a real merge conflict as generated by git.
Test artificial conflict detection while pending merge without a real conflict.
Test artificial non-conflict non-detection in a resolved merge conflict.
Rename test_does_not_care... function to reflect what we want to care about.
Rename is_in_merge_conflict to is_in_merge since that is what it checks.
This commit is contained in:
Alexander Dupuy 2015-05-07 23:04:15 +02:00 committed by Alexander Dupuy
parent eefc46f901
commit 5c752935fd
2 changed files with 42 additions and 6 deletions

View file

@ -13,7 +13,7 @@ CONFLICT_PATTERNS = [
WARNING_MSG = 'Merge conflict string "{0}" found in {1}:{2}'
def is_in_merge_conflict():
def is_in_merge():
return (
os.path.exists(os.path.join('.git', 'MERGE_MSG')) and
os.path.exists(os.path.join('.git', 'MERGE_HEAD'))
@ -25,7 +25,7 @@ def detect_merge_conflict(argv=None):
parser.add_argument('filenames', nargs='*')
args = parser.parse_args(argv)
if not is_in_merge_conflict():
if not is_in_merge():
return 0
retcode = 0