1185.82.7
by John Arbash Meinel
Adding patches.py into bzrlib, including the tests into the test suite. |
1 |
# Copyright (C) 2004-2006 by Canonical Ltd
|
2 |
||
3 |
# This program is free software; you can redistribute it and/or modify
|
|
4 |
# it under the terms of the GNU General Public License as published by
|
|
5 |
# the Free Software Foundation; either version 2 of the License, or
|
|
6 |
# (at your option) any later version.
|
|
7 |
||
8 |
# This program is distributed in the hope that it will be useful,
|
|
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11 |
# GNU General Public License for more details.
|
|
12 |
||
13 |
# You should have received a copy of the GNU General Public License
|
|
14 |
# along with this program; if not, write to the Free Software
|
|
15 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
16 |
||
17 |
# Just import the tester built-into the patch file
|
|
18 |
||
19 |
from bzrlib.patches import PatchesTester |
|
1185.82.9
by John Arbash Meinel
Moving patches testing into main test suite. |
20 |
from bzrlib.osutils import pathjoin |
1185.82.7
by John Arbash Meinel
Adding patches.py into bzrlib, including the tests into the test suite. |
21 |
import os |
22 |
||
23 |
||
24 |
# We have to inherit so that unittest will consider it
|
|
25 |
# Also, the testdata directory is relative to this file
|
|
26 |
# so override datafile
|
|
27 |
class TestPatches(PatchesTester): |
|
28 |
||
29 |
def datafile(self, filename): |
|
1185.82.9
by John Arbash Meinel
Moving patches testing into main test suite. |
30 |
data_path = os.path.join(os.path.dirname(__file__), |
31 |
"test_patches_data", filename) |
|
1185.82.7
by John Arbash Meinel
Adding patches.py into bzrlib, including the tests into the test suite. |
32 |
return file(data_path, "rb") |
33 |
||
1185.82.9
by John Arbash Meinel
Moving patches testing into main test suite. |
34 |
# we have to delete the original, or it will also be tested
|
35 |
del PatchesTester |