def test_find_intersecting_diffs__list(self): diff = load_fixture('diff/intersecting_hunks_original.txt') diffs = parse_diff(diff) result = fixers.find_intersecting_diffs(diffs, []) self.assertEqual(0, len(result)) result = fixers.find_intersecting_diffs([], diff) self.assertEqual(0, len(result))
def test_find_intersecting_diffs__list(): diff = load_fixture('diff/intersecting_hunks_original.txt') diffs = parse_diff(diff) result = fixers.find_intersecting_diffs(diffs, []) eq_(0, len(result)) result = fixers.find_intersecting_diffs([], diff) eq_(0, len(result))
def test_find_intersecting_diffs__no_intersect(self): original = load_fixture('diff/intersecting_hunks_original.txt') updated = load_fixture('diff/adjacent_original.txt') original = parse_diff(original) updated = parse_diff(updated) result = fixers.find_intersecting_diffs(original, updated) self.assertEqual(0, len(result))
def test_find_intersecting_diffs__no_intersect(): original = load_fixture('diff/intersecting_hunks_original.txt') updated = load_fixture('diff/adjacent_original.txt') original = parse_diff(original) updated = parse_diff(updated) result = fixers.find_intersecting_diffs(original, updated) eq_(0, len(result))
def test_find_intersecting_diffs(self): original = load_fixture('diff/intersecting_hunks_original.txt') updated = load_fixture('diff/intersecting_hunks_updated.txt') original = parse_diff(original) updated = parse_diff(updated) result = fixers.find_intersecting_diffs(original, updated) self.assertEqual(1, len(result)) assert isinstance(result[0], Diff) self.assertEqual('model.php', result[0].filename) self.assertEqual('00000', result[0].commit)
def test_find_intersecting_diffs(): original = load_fixture('diff/intersecting_hunks_original.txt') updated = load_fixture('diff/intersecting_hunks_updated.txt') original = parse_diff(original) updated = parse_diff(updated) result = fixers.find_intersecting_diffs(original, updated) eq_(1, len(result)) assert isinstance(result[0], Diff) eq_('model.php', result[0].filename) eq_('00000', result[0].commit)