1
# Copyright (C) 2004 - 2006 Aaron Bentley, Canonical Ltd
1
# Copyright (C) 2004 - 2006 Aaron Bentley
2
2
# <aaron.bentley@utoronto.ca>
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
183
182
patch = parse_patch(self.datafile("insert_top.patch"))
184
183
assert (patch.pos_in_mod(0)==1)
186
def testParsePatches(self):
187
"""Make sure file names can be extracted from tricky unified diffs"""
214
filenames = [('orig-7', 'mod-7'),
216
patches = parse_patches(patchtext.splitlines(True))
218
for patch in patches:
219
patch_files.append((patch.oldname, patch.newname))
220
assert (patch_files == filenames)
223
186
patchesTestSuite = unittest.makeSuite(PatchesTester,'test')
224
187
runner = unittest.TextTestRunner(verbosity=0)