def test_git_patch(self): patch_data = 'Index: chrome/file.cc\n' + GIT.PATCH patchset = patch_path_filter.parse_git_patch_set(patch_data) self._verify_patch(patchset)
def test_git_patch_two_files(self): patch_data = 'Index: chrome/file.cc\n' + GIT.PATCH + GIT.RENAME patchset = patch_path_filter.parse_git_patch_set(patch_data) self.assertEqual(2, len(patchset.filenames)) self.assertEqual('tools/run_local_server.sh', patchset.filenames[0]) self.assertEqual('chrome/file.cc', patchset.filenames[1])
def test_git_empty(self): patchset = patch_path_filter.parse_git_patch_set('') self.assertEqual(0, len(patchset.filenames))