Merge lp:~jml/pkgme/imports-and-tempdir into lp:pkgme
- imports-and-tempdir
- Merge into trunk
Proposed by
Jonathan Lange
Status: | Merged |
---|---|
Approved by: | Jonathan Lange |
Approved revision: | 194 |
Merged at revision: | 140 |
Proposed branch: | lp:~jml/pkgme/imports-and-tempdir |
Merge into: | lp:pkgme |
Prerequisite: | lp:~jml/pkgme/api-rationalization |
Diff against target: |
1362 lines (+288/-324) 20 files modified
NEWS.txt (+11/-5) pkgme/testing.py (+8/-9) pkgme/tests/test_api.py (+6/-6) pkgme/tests/test_backend.py (+45/-51) pkgme/tests/test_debuild.py (+16/-28) pkgme/tests/test_distutils_command.py (+11/-10) pkgme/tests/test_info_elements.py (+2/-2) pkgme/tests/test_main.py (+4/-4) pkgme/tests/test_package_files.py (+13/-15) pkgme/tests/test_project_info.py (+60/-66) pkgme/tests/test_python_backend.py (+9/-10) pkgme/tests/test_run_script.py (+1/-1) pkgme/tests/test_script.py (+15/-24) pkgme/tests/test_template_file.py (+1/-1) pkgme/tests/test_testing.py (+1/-1) pkgme/tests/test_trace.py (+9/-8) pkgme/tests/test_upload.py (+1/-1) pkgme/tests/test_vala_backend.py (+45/-53) pkgme/tests/test_write.py (+29/-28) versions.cfg (+1/-1) |
To merge this branch: | bzr merge lp:~jml/pkgme/imports-and-tempdir |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Westby | Approve | ||
Review via email: mp+122551@code.launchpad.net |
Commit message
Deprecate TempdirFixture. Use treeshape 0.2.1 instead.
Description of the change
Changes the tests to use treeshape rather than TempdirFixture. This cuts down on lines of code and allows us to delete stuff from pkgme.testing if we so choose, which in turn will simplify dependency touch points.
To post a comment you must log in.
- 194. By Jonathan Lange
-
Merge trunk, resolving conflicts.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'NEWS.txt' | |||
2 | --- NEWS.txt 2012-09-03 14:31:00 +0000 | |||
3 | +++ NEWS.txt 2012-09-04 15:26:25 +0000 | |||
4 | @@ -15,14 +15,20 @@ | |||
5 | 15 | * New module ``pkgme.api`` that has the useful stuff from the pkgme script. | 15 | * New module ``pkgme.api`` that has the useful stuff from the pkgme script. |
6 | 16 | (Jonathan Lange) | 16 | (Jonathan Lange) |
7 | 17 | 17 | ||
9 | 18 | * ``pkgme.bin.main.get_all_info`` is deprecated. Use | 18 | |
10 | 19 | Deprecations | ||
11 | 20 | ------------ | ||
12 | 21 | |||
13 | 22 | * ``pkgme.bin.main.get_all_info``. Use | ||
14 | 19 | ``packaging_info_as_data(get_all_info(...))`` instead. Both are in | 23 | ``packaging_info_as_data(get_all_info(...))`` instead. Both are in |
15 | 20 | ``pkgme.api``. (Jonathan Lange) | 24 | ``pkgme.api``. (Jonathan Lange) |
16 | 21 | 25 | ||
21 | 22 | * ``pkgme.write_packaging`` is deprecated. Instead use | 26 | * ``pkgme.write_packaging``. Instead use ``pkgme.api.get_all_info`` to get |
22 | 23 | ``pkgme.api.get_all_info`` to get packaging information, and | 27 | packaging information, and ``pkgme.api.write_packaging_info`` to write it |
23 | 24 | ``pkgme.api.write_packaging_info`` to write it out to disk. | 28 | out to disk. (Jonathan Lange) |
24 | 25 | (Jonathan Lange) | 29 | |
25 | 30 | * From ``pkgme.testing``, ``TempdirFixture``, ``FileFixture`` and | ||
26 | 31 | ``ExecutableFileFixture``. Use ``treeshape.FileTree`` instead. | ||
27 | 26 | 32 | ||
28 | 27 | 33 | ||
29 | 28 | 0.3.1 (2012-08-28) | 34 | 0.3.1 (2012-08-28) |
30 | 29 | 35 | ||
31 | === modified file 'pkgme/testing.py' | |||
32 | --- pkgme/testing.py 2012-08-06 13:26:13 +0000 | |||
33 | +++ pkgme/testing.py 2012-09-04 15:26:25 +0000 | |||
34 | @@ -1,12 +1,13 @@ | |||
35 | 1 | from ConfigParser import ConfigParser | 1 | from ConfigParser import ConfigParser |
36 | 2 | import os | 2 | import os |
37 | 3 | import shutil | ||
38 | 4 | from StringIO import StringIO | 3 | from StringIO import StringIO |
39 | 5 | import tempfile | ||
40 | 6 | import subprocess | 4 | import subprocess |
41 | 7 | 5 | ||
42 | 8 | from debian import deb822 | 6 | from debian import deb822 |
44 | 9 | from fixtures import Fixture | 7 | from fixtures import ( |
45 | 8 | Fixture, | ||
46 | 9 | TempDir, | ||
47 | 10 | ) | ||
48 | 10 | from testtools.matchers import ( | 11 | from testtools.matchers import ( |
49 | 11 | Equals, | 12 | Equals, |
50 | 12 | Matcher, | 13 | Matcher, |
51 | @@ -22,12 +23,8 @@ | |||
52 | 22 | from pkgme.write import write_file | 23 | from pkgme.write import write_file |
53 | 23 | 24 | ||
54 | 24 | 25 | ||
61 | 25 | class TempdirFixture(Fixture): | 26 | class TempdirFixture(TempDir): |
62 | 26 | 27 | """DEPRECATED - Use ``treeshape.FileTree`` instead.""" | |
57 | 27 | def setUp(self): | ||
58 | 28 | Fixture.setUp(self) | ||
59 | 29 | self.path = tempfile.mkdtemp(prefix="pkgme-tests-") | ||
60 | 30 | self.addCleanup(shutil.rmtree, self.path) | ||
63 | 31 | 28 | ||
64 | 32 | def abspath(self, relpath): | 29 | def abspath(self, relpath): |
65 | 33 | return os.path.abspath(os.path.join(self.path, relpath)) | 30 | return os.path.abspath(os.path.join(self.path, relpath)) |
66 | @@ -53,6 +50,7 @@ | |||
67 | 53 | 50 | ||
68 | 54 | 51 | ||
69 | 55 | class FileFixture(Fixture): | 52 | class FileFixture(Fixture): |
70 | 53 | """DEPRECATED - Use ``treeshape.FileTree`` instead.""" | ||
71 | 56 | 54 | ||
72 | 57 | def __init__(self, path, contents): | 55 | def __init__(self, path, contents): |
73 | 58 | super(FileFixture, self).__init__() | 56 | super(FileFixture, self).__init__() |
74 | @@ -67,6 +65,7 @@ | |||
75 | 67 | 65 | ||
76 | 68 | 66 | ||
77 | 69 | class ExecutableFileFixture(FileFixture): | 67 | class ExecutableFileFixture(FileFixture): |
78 | 68 | """DEPRECATED - Use ``treeshape.FileTree`` instead.""" | ||
79 | 70 | 69 | ||
80 | 71 | def setUp(self): | 70 | def setUp(self): |
81 | 72 | FileFixture.setUp(self) | 71 | FileFixture.setUp(self) |
82 | 73 | 72 | ||
83 | === modified file 'pkgme/tests/test_api.py' | |||
84 | --- pkgme/tests/test_api.py 2012-09-03 14:19:36 +0000 | |||
85 | +++ pkgme/tests/test_api.py 2012-09-04 15:26:25 +0000 | |||
86 | @@ -5,18 +5,18 @@ | |||
87 | 5 | from treeshape import HasFileTree | 5 | from treeshape import HasFileTree |
88 | 6 | 6 | ||
89 | 7 | from .. import write_packaging | 7 | from .. import write_packaging |
93 | 8 | from pkgme.api import write_packaging_info | 8 | from ..api import write_packaging_info |
94 | 9 | from pkgme.backend import StaticBackend | 9 | from ..backend import StaticBackend |
95 | 10 | from pkgme.info_elements import ( | 10 | from ..info_elements import ( |
96 | 11 | Architecture, | 11 | Architecture, |
97 | 12 | Description, | 12 | Description, |
98 | 13 | Maintainer, | 13 | Maintainer, |
99 | 14 | PackageName, | 14 | PackageName, |
100 | 15 | Version, | 15 | Version, |
101 | 16 | ) | 16 | ) |
105 | 17 | from pkgme.package_files import Control, DEBIAN_DIR | 17 | from ..package_files import Control, DEBIAN_DIR |
106 | 18 | from pkgme.project_info import DictInfo | 18 | from ..project_info import DictInfo |
107 | 19 | from pkgme.testing import ( | 19 | from ..testing import ( |
108 | 20 | ControlSourceStanzaHasField, | 20 | ControlSourceStanzaHasField, |
109 | 21 | StaticLoaderFixture, | 21 | StaticLoaderFixture, |
110 | 22 | ) | 22 | ) |
111 | 23 | 23 | ||
112 | === modified file 'pkgme/tests/test_backend.py' | |||
113 | --- pkgme/tests/test_backend.py 2012-08-31 09:23:08 +0000 | |||
114 | +++ pkgme/tests/test_backend.py 2012-09-04 15:26:25 +0000 | |||
115 | @@ -1,10 +1,14 @@ | |||
116 | 1 | import os | 1 | import os |
117 | 2 | import sys | 2 | import sys |
118 | 3 | 3 | ||
120 | 4 | from fixtures import TestWithFixtures | 4 | from fixtures import TempDir |
121 | 5 | from testtools import TestCase | 5 | from testtools import TestCase |
122 | 6 | from treeshape import ( | ||
123 | 7 | FileTree, | ||
124 | 8 | from_rough_spec, | ||
125 | 9 | ) | ||
126 | 6 | 10 | ||
128 | 7 | from pkgme.backend import ( | 11 | from ..backend import ( |
129 | 8 | Backend, | 12 | Backend, |
130 | 9 | BackendSelector, | 13 | BackendSelector, |
131 | 10 | EXTERNAL_BACKEND_PATHS, | 14 | EXTERNAL_BACKEND_PATHS, |
132 | @@ -19,17 +23,12 @@ | |||
133 | 19 | StaticLoader, | 23 | StaticLoader, |
134 | 20 | WantError, | 24 | WantError, |
135 | 21 | ) | 25 | ) |
137 | 22 | from pkgme.project_info import ( | 26 | from ..project_info import ( |
138 | 23 | MultipleExternalHelpersInfo, | 27 | MultipleExternalHelpersInfo, |
139 | 24 | SingleExternalHelperInfo, | 28 | SingleExternalHelperInfo, |
140 | 25 | ) | 29 | ) |
148 | 26 | from pkgme.run_script import ScriptUserError | 30 | from ..run_script import ScriptUserError |
149 | 27 | from pkgme.testing import ( | 31 | from ..testing import StaticLoaderFixture |
143 | 28 | ExecutableFileFixture, | ||
144 | 29 | FileFixture, | ||
145 | 30 | StaticLoaderFixture, | ||
146 | 31 | TempdirFixture, | ||
147 | 32 | ) | ||
150 | 33 | 32 | ||
151 | 34 | 33 | ||
152 | 35 | class TestBackend(TestCase): | 34 | class TestBackend(TestCase): |
153 | @@ -40,18 +39,17 @@ | |||
154 | 40 | self.assertEqual(backend.name, backend.describe()) | 39 | self.assertEqual(backend.name, backend.describe()) |
155 | 41 | 40 | ||
156 | 42 | 41 | ||
158 | 43 | class ExternalHelpersBackendTests(TestCase, TestWithFixtures): | 42 | class ExternalHelpersBackendTests(TestCase): |
159 | 44 | 43 | ||
160 | 45 | def make_want_script(self, script, executable=True): | 44 | def make_want_script(self, script, executable=True): |
161 | 46 | tempdir = self.useFixture(TempdirFixture()) | ||
162 | 47 | script_name = ExternalHelpersBackend.WANT_SCRIPT_NAME | ||
163 | 48 | script_path = os.path.join(tempdir.path, script_name) | ||
164 | 49 | if executable: | 45 | if executable: |
166 | 50 | cls = ExecutableFileFixture | 46 | permissions = 0700 |
167 | 51 | else: | 47 | else: |
171 | 52 | cls = FileFixture | 48 | permissions = 0600 |
172 | 53 | self.useFixture(cls(script_path, script)) | 49 | script_name = ExternalHelpersBackend.WANT_SCRIPT_NAME |
173 | 54 | return tempdir | 50 | return self.useFixture( |
174 | 51 | FileTree({script_name: {'content': script, | ||
175 | 52 | 'permissions': permissions}})) | ||
176 | 55 | 53 | ||
177 | 56 | def test_describe(self): | 54 | def test_describe(self): |
178 | 57 | backend = ExternalHelpersBackend( | 55 | backend = ExternalHelpersBackend( |
179 | @@ -145,13 +143,13 @@ | |||
180 | 145 | self.assertEqual((10, None), backend.want(tempdir.path)) | 143 | self.assertEqual((10, None), backend.want(tempdir.path)) |
181 | 146 | 144 | ||
182 | 147 | def test_missing_want_script(self): | 145 | def test_missing_want_script(self): |
184 | 148 | tempdir = self.useFixture(TempdirFixture()) | 146 | path = self.useFixture(TempDir()).path |
185 | 149 | name = self.getUniqueString() | 147 | name = self.getUniqueString() |
188 | 150 | backend = ExternalHelpersBackend(name, tempdir.path) | 148 | backend = ExternalHelpersBackend(name, path) |
189 | 151 | e = self.assertRaises(AssertionError, backend.want, tempdir.path) | 149 | e = self.assertRaises(AssertionError, backend.want, path) |
190 | 152 | self.assertEqual( | 150 | self.assertEqual( |
191 | 153 | "Backend %s (%s) has no '%s' script" | 151 | "Backend %s (%s) has no '%s' script" |
193 | 154 | % (name, tempdir.path, ExternalHelpersBackend.WANT_SCRIPT_NAME), | 152 | % (name, path, ExternalHelpersBackend.WANT_SCRIPT_NAME), |
194 | 155 | str(e)) | 153 | str(e)) |
195 | 156 | 154 | ||
196 | 157 | def test_want_script_not_executable(self): | 155 | def test_want_script_not_executable(self): |
197 | @@ -219,18 +217,18 @@ | |||
198 | 219 | str(e)) | 217 | str(e)) |
199 | 220 | 218 | ||
200 | 221 | def test_want_script_run_in_correct_dir(self): | 219 | def test_want_script_run_in_correct_dir(self): |
202 | 222 | cwd_tempdir = self.useFixture(TempdirFixture()) | 220 | cwd_tempdir = self.useFixture(TempDir()).path |
203 | 223 | script = """#!%s | 221 | script = """#!%s |
204 | 224 | import os | 222 | import os |
205 | 225 | if os.getcwd() != '%s': | 223 | if os.getcwd() != '%s': |
206 | 226 | print "Backend was called in %%s rather than %%s" %% (os.getcwd(), '%s') | 224 | print "Backend was called in %%s rather than %%s" %% (os.getcwd(), '%s') |
207 | 227 | else: | 225 | else: |
208 | 228 | print 10 | 226 | print 10 |
210 | 229 | """ % (sys.executable, cwd_tempdir.path, cwd_tempdir.path) | 227 | """ % (sys.executable, cwd_tempdir, cwd_tempdir) |
211 | 230 | backend_tempdir = self.make_want_script(script) | 228 | backend_tempdir = self.make_want_script(script) |
212 | 231 | backend = ExternalHelpersBackend( | 229 | backend = ExternalHelpersBackend( |
213 | 232 | self.getUniqueString(), backend_tempdir.path) | 230 | self.getUniqueString(), backend_tempdir.path) |
215 | 233 | self.assertEqual((10, None), backend.want(cwd_tempdir.path)) | 231 | self.assertEqual((10, None), backend.want(cwd_tempdir)) |
216 | 234 | 232 | ||
217 | 235 | def test_get_info_with_multiple(self): | 233 | def test_get_info_with_multiple(self): |
218 | 236 | helpers_path = self.getUniqueString() | 234 | helpers_path = self.getUniqueString() |
219 | @@ -242,18 +240,18 @@ | |||
220 | 242 | self.assertEqual(cwd_path, project_info.cwd) | 240 | self.assertEqual(cwd_path, project_info.cwd) |
221 | 243 | 241 | ||
222 | 244 | def test_get_info_with_single(self): | 242 | def test_get_info_with_single(self): |
224 | 245 | helpers_tempdir = self.useFixture(TempdirFixture()) | 243 | helpers_tempdir = self.useFixture(TempDir()).path |
225 | 246 | info_script_path = os.path.join( | 244 | info_script_path = os.path.join( |
227 | 247 | helpers_tempdir.path, | 245 | helpers_tempdir, |
228 | 248 | SingleExternalHelperInfo.INFO_SCRIPT_NAME) | 246 | SingleExternalHelperInfo.INFO_SCRIPT_NAME) |
229 | 249 | with open(info_script_path, "w"): | 247 | with open(info_script_path, "w"): |
230 | 250 | pass | 248 | pass |
231 | 251 | cwd_path = self.getUniqueString() | 249 | cwd_path = self.getUniqueString() |
232 | 252 | backend = ExternalHelpersBackend( | 250 | backend = ExternalHelpersBackend( |
234 | 253 | self.getUniqueString(), helpers_tempdir.path) | 251 | self.getUniqueString(), helpers_tempdir) |
235 | 254 | project_info = backend.get_info(cwd_path) | 252 | project_info = backend.get_info(cwd_path) |
236 | 255 | self.assertIsInstance(project_info, SingleExternalHelperInfo) | 253 | self.assertIsInstance(project_info, SingleExternalHelperInfo) |
238 | 256 | self.assertEqual(helpers_tempdir.path, project_info.basepath) | 254 | self.assertEqual(helpers_tempdir, project_info.basepath) |
239 | 257 | self.assertEqual(cwd_path, project_info.cwd) | 255 | self.assertEqual(cwd_path, project_info.cwd) |
240 | 258 | 256 | ||
241 | 259 | 257 | ||
242 | @@ -415,42 +413,40 @@ | |||
243 | 415 | selector.get_eligible_backends(path)) | 413 | selector.get_eligible_backends(path)) |
244 | 416 | 414 | ||
245 | 417 | 415 | ||
247 | 418 | class ExternalHelpersBackendLoaderTests(TestCase, TestWithFixtures): | 416 | class ExternalHelpersBackendLoaderTests(TestCase): |
248 | 417 | |||
249 | 418 | def make_tree(self, *args): | ||
250 | 419 | return self.useFixture(FileTree(from_rough_spec(args))) | ||
251 | 419 | 420 | ||
252 | 420 | def test_loads_no_backends(self): | 421 | def test_loads_no_backends(self): |
255 | 421 | tempdir = self.useFixture(TempdirFixture()) | 422 | loader = ExternalHelpersBackendLoader([]) |
254 | 422 | loader = ExternalHelpersBackendLoader([tempdir.path]) | ||
256 | 423 | self.assertEqual([], loader.load()) | 423 | self.assertEqual([], loader.load()) |
257 | 424 | 424 | ||
258 | 425 | def test_loads_from_one_dir(self): | 425 | def test_loads_from_one_dir(self): |
259 | 426 | tempdir = self.useFixture(TempdirFixture()) | ||
260 | 427 | backend_name = self.getUniqueString() | 426 | backend_name = self.getUniqueString() |
263 | 428 | basepath = tempdir.mkdir(backend_name) | 427 | tree = self.make_tree(backend_name + '/') |
264 | 429 | loader = ExternalHelpersBackendLoader([tempdir.path]) | 428 | loader = ExternalHelpersBackendLoader([tree.path]) |
265 | 430 | backends = loader.load() | 429 | backends = loader.load() |
266 | 431 | self.assertEqual(1, len(backends)) | 430 | self.assertEqual(1, len(backends)) |
267 | 432 | self.assertIsInstance(backends[0], ExternalHelpersBackend) | 431 | self.assertIsInstance(backends[0], ExternalHelpersBackend) |
268 | 433 | self.assertEqual(backend_name, backends[0].name) | 432 | self.assertEqual(backend_name, backends[0].name) |
270 | 434 | self.assertEqual(basepath, backends[0].basepath) | 433 | self.assertEqual(tree.join(backend_name), backends[0].basepath) |
271 | 435 | 434 | ||
272 | 436 | def test_loads_from_two_dirs(self): | 435 | def test_loads_from_two_dirs(self): |
273 | 437 | tempdir1 = self.useFixture(TempdirFixture()) | ||
274 | 438 | tempdir2 = self.useFixture(TempdirFixture()) | ||
275 | 439 | backend_name1 = self.getUniqueString() | 436 | backend_name1 = self.getUniqueString() |
276 | 440 | backend_name2 = self.getUniqueString() | 437 | backend_name2 = self.getUniqueString() |
279 | 441 | tempdir1.mkdir(backend_name1) | 438 | tempdir1 = self.make_tree(backend_name1 + '/') |
280 | 442 | tempdir2.mkdir(backend_name2) | 439 | tempdir2 = self.make_tree(backend_name2 + '/') |
281 | 443 | loader = ExternalHelpersBackendLoader( | 440 | loader = ExternalHelpersBackendLoader( |
282 | 444 | [tempdir1.path, tempdir2.path]) | 441 | [tempdir1.path, tempdir2.path]) |
283 | 445 | backends = loader.load() | 442 | backends = loader.load() |
284 | 446 | self.assertEqual(2, len(backends)) | 443 | self.assertEqual(2, len(backends)) |
285 | 447 | 444 | ||
286 | 448 | def test_loads_only_one_instance_of_each_name(self): | 445 | def test_loads_only_one_instance_of_each_name(self): |
287 | 449 | tempdir1 = self.useFixture(TempdirFixture()) | ||
288 | 450 | tempdir2 = self.useFixture(TempdirFixture()) | ||
289 | 451 | backend_name = self.getUniqueString() | 446 | backend_name = self.getUniqueString() |
292 | 452 | basepath1 = tempdir1.mkdir(backend_name) | 447 | tempdir1 = self.make_tree(backend_name + '/') |
293 | 453 | tempdir2.mkdir(backend_name) | 448 | tempdir2 = self.make_tree(backend_name + '/') |
294 | 449 | basepath1 = tempdir1.join(backend_name) | ||
295 | 454 | loader = ExternalHelpersBackendLoader( | 450 | loader = ExternalHelpersBackendLoader( |
296 | 455 | [tempdir1.path, tempdir2.path]) | 451 | [tempdir1.path, tempdir2.path]) |
297 | 456 | backends = loader.load() | 452 | backends = loader.load() |
298 | @@ -458,19 +454,17 @@ | |||
299 | 458 | self.assertEqual(basepath1, backends[0].basepath) | 454 | self.assertEqual(basepath1, backends[0].basepath) |
300 | 459 | 455 | ||
301 | 460 | def test_loads_only_dirs(self): | 456 | def test_loads_only_dirs(self): |
305 | 461 | tempdir = self.useFixture(TempdirFixture()) | 457 | path = self.make_tree(self.getUniqueString()).path |
306 | 462 | tempdir.touch(self.getUniqueString()) | 458 | loader = ExternalHelpersBackendLoader([path]) |
304 | 463 | loader = ExternalHelpersBackendLoader([tempdir.path]) | ||
307 | 464 | self.assertEqual([], loader.load()) | 459 | self.assertEqual([], loader.load()) |
308 | 465 | 460 | ||
309 | 466 | def test_ignores_dotdirs(self): | 461 | def test_ignores_dotdirs(self): |
313 | 467 | tempdir = self.useFixture(TempdirFixture()) | 462 | dirname = '.%s/' % (self.getUniqueString(),) |
314 | 468 | tempdir.mkdir("." + self.getUniqueString()) | 463 | tempdir = self.make_tree(dirname).path |
315 | 469 | loader = ExternalHelpersBackendLoader([tempdir.path]) | 464 | loader = ExternalHelpersBackendLoader([tempdir]) |
316 | 470 | self.assertEqual([], loader.load()) | 465 | self.assertEqual([], loader.load()) |
317 | 471 | 466 | ||
318 | 472 | def test_ignores_missing_dirs(self): | 467 | def test_ignores_missing_dirs(self): |
319 | 473 | self.useFixture(TempdirFixture()) | ||
320 | 474 | loader = ExternalHelpersBackendLoader([self.getUniqueString()]) | 468 | loader = ExternalHelpersBackendLoader([self.getUniqueString()]) |
321 | 475 | self.assertEqual([], loader.load()) | 469 | self.assertEqual([], loader.load()) |
322 | 476 | 470 | ||
323 | 477 | 471 | ||
324 | === modified file 'pkgme/tests/test_debuild.py' | |||
325 | --- pkgme/tests/test_debuild.py 2012-08-06 18:21:44 +0000 | |||
326 | +++ pkgme/tests/test_debuild.py 2012-09-04 15:26:25 +0000 | |||
327 | @@ -2,37 +2,26 @@ | |||
328 | 2 | import tarfile | 2 | import tarfile |
329 | 3 | 3 | ||
330 | 4 | from testtools import TestCase | 4 | from testtools import TestCase |
331 | 5 | from treeshape import FileTree | ||
332 | 5 | 6 | ||
334 | 6 | from pkgme.debuild import ( | 7 | from ..debuild import ( |
335 | 7 | _find_binary_files_in_dir, | 8 | _find_binary_files_in_dir, |
336 | 8 | build_debian_source_include_binaries_content, | 9 | build_debian_source_include_binaries_content, |
337 | 9 | build_orig_tar_gz, | 10 | build_orig_tar_gz, |
338 | 10 | ) | 11 | ) |
357 | 11 | from pkgme.testing import ( | 12 | |
358 | 12 | TempdirFixture, | 13 | |
359 | 13 | ) | 14 | def DebianTempDirFixture(): |
360 | 14 | 15 | return FileTree( | |
361 | 15 | 16 | {'debian/icons/': {}, | |
362 | 16 | class DebianTempDirFixture(TempdirFixture): | 17 | 'debian/source/': {}}) |
345 | 17 | """A temp directory with a "testpkg" directory that contains | ||
346 | 18 | a skeleton dir debian/ structure | ||
347 | 19 | """ | ||
348 | 20 | |||
349 | 21 | def setUp(self, with_binary_data=False): | ||
350 | 22 | super(DebianTempDirFixture, self).setUp() | ||
351 | 23 | self.pkgdir = self.abspath("testpkg") | ||
352 | 24 | self.icon_path = os.path.join(self.pkgdir, "debian", "icons") | ||
353 | 25 | self.debian_source_path = os.path.join(self.pkgdir, "debian", "source") | ||
354 | 26 | # setup fake env | ||
355 | 27 | os.makedirs(self.icon_path) | ||
356 | 28 | os.makedirs(self.debian_source_path) | ||
363 | 29 | 18 | ||
364 | 30 | 19 | ||
365 | 31 | class BuildTarTestCase(TestCase): | 20 | class BuildTarTestCase(TestCase): |
366 | 32 | 21 | ||
367 | 33 | def test_build_orig_tar_gz(self): | 22 | def test_build_orig_tar_gz(self): |
368 | 34 | tempdir = self.useFixture(DebianTempDirFixture()) | 23 | tempdir = self.useFixture(DebianTempDirFixture()) |
370 | 35 | changelog_path = os.path.join(tempdir.pkgdir, "debian", "changelog") | 24 | changelog_path = tempdir.join("debian", "changelog") |
371 | 36 | with open(changelog_path, "w") as f: | 25 | with open(changelog_path, "w") as f: |
372 | 37 | f.write(""" | 26 | f.write(""" |
373 | 38 | testpkg (0.1) unstable; urgency=low | 27 | testpkg (0.1) unstable; urgency=low |
374 | @@ -41,10 +30,10 @@ | |||
375 | 41 | 30 | ||
376 | 42 | -- Some Guy <foo@example.com> Thu, 19 Apr 2012 10:53:30 +0200 | 31 | -- Some Guy <foo@example.com> Thu, 19 Apr 2012 10:53:30 +0200 |
377 | 43 | """) | 32 | """) |
379 | 44 | with open(os.path.join(tempdir.pkgdir, "canary"), "w") as f: | 33 | with open(tempdir.join("canary"), "w") as f: |
380 | 45 | f.write("pieep") | 34 | f.write("pieep") |
381 | 46 | # build it | 35 | # build it |
383 | 47 | result_path = build_orig_tar_gz(tempdir.pkgdir) | 36 | result_path = build_orig_tar_gz(tempdir.path) |
384 | 48 | # verify | 37 | # verify |
385 | 49 | self.assertEqual( | 38 | self.assertEqual( |
386 | 50 | "testpkg_0.1.orig.tar.gz", os.path.basename(result_path)) | 39 | "testpkg_0.1.orig.tar.gz", os.path.basename(result_path)) |
387 | @@ -58,14 +47,14 @@ | |||
388 | 58 | 47 | ||
389 | 59 | def _make_icons(self, tempdir): | 48 | def _make_icons(self, tempdir): |
390 | 60 | for icon_name in ["foo.png", "bar.png"]: | 49 | for icon_name in ["foo.png", "bar.png"]: |
392 | 61 | with open(os.path.join(tempdir.icon_path, icon_name), "w") as f: | 50 | icon_path = tempdir.join('debian', 'icons', icon_name) |
393 | 51 | with open(icon_path, "w") as f: | ||
394 | 62 | f.write("x\0x") | 52 | f.write("x\0x") |
395 | 63 | 53 | ||
396 | 64 | def test_find_binary_files(self): | 54 | def test_find_binary_files(self): |
397 | 65 | tempdir = self.useFixture(DebianTempDirFixture()) | 55 | tempdir = self.useFixture(DebianTempDirFixture()) |
398 | 66 | self._make_icons(tempdir) | 56 | self._make_icons(tempdir) |
401 | 67 | bin_files = _find_binary_files_in_dir(os.path.join( | 57 | bin_files = _find_binary_files_in_dir(tempdir.join('debian')) |
400 | 68 | tempdir.pkgdir, "debian")) | ||
402 | 69 | self.assertEqual( | 58 | self.assertEqual( |
403 | 70 | sorted(["icons/foo.png", "icons/bar.png"]), | 59 | sorted(["icons/foo.png", "icons/bar.png"]), |
404 | 71 | sorted(bin_files)) | 60 | sorted(bin_files)) |
405 | @@ -73,11 +62,10 @@ | |||
406 | 73 | def test_build_debian_source_include_binaries_content(self): | 62 | def test_build_debian_source_include_binaries_content(self): |
407 | 74 | tempdir = self.useFixture(DebianTempDirFixture()) | 63 | tempdir = self.useFixture(DebianTempDirFixture()) |
408 | 75 | self._make_icons(tempdir) | 64 | self._make_icons(tempdir) |
410 | 76 | build_debian_source_include_binaries_content(tempdir.pkgdir) | 65 | build_debian_source_include_binaries_content(tempdir.path) |
411 | 77 | expected_binaries = sorted( | 66 | expected_binaries = sorted( |
412 | 78 | ['debian/icons/foo.png', 'debian/icons/bar.png']) | 67 | ['debian/icons/foo.png', 'debian/icons/bar.png']) |
415 | 79 | include_binaries = os.path.join( | 68 | include_binaries = tempdir.join('debian', 'source', "include-binaries") |
414 | 80 | tempdir.debian_source_path, "include-binaries") | ||
416 | 81 | with open(include_binaries) as f: | 69 | with open(include_binaries) as f: |
417 | 82 | found_binaries = sorted(line.strip() for line in f.readlines()) | 70 | found_binaries = sorted(line.strip() for line in f.readlines()) |
418 | 83 | self.assertEqual(expected_binaries, found_binaries) | 71 | self.assertEqual(expected_binaries, found_binaries) |
419 | 84 | 72 | ||
420 | === modified file 'pkgme/tests/test_distutils_command.py' | |||
421 | --- pkgme/tests/test_distutils_command.py 2012-05-28 21:37:22 +0000 | |||
422 | +++ pkgme/tests/test_distutils_command.py 2012-09-04 15:26:25 +0000 | |||
423 | @@ -1,14 +1,15 @@ | |||
424 | 1 | from distutils.dist import Distribution | 1 | from distutils.dist import Distribution |
425 | 2 | import json | 2 | import json |
426 | 3 | import os | ||
427 | 3 | 4 | ||
429 | 4 | from fixtures import TestWithFixtures | 5 | from fixtures import TempDir |
430 | 5 | from testtools import TestCase | 6 | from testtools import TestCase |
431 | 6 | 7 | ||
437 | 7 | from pkgme.distutils_command.pkgme_info import pkgme_info | 8 | from ..distutils_command.pkgme_info import pkgme_info |
438 | 8 | from pkgme.testing import PathRequiredTestCase, TempdirFixture | 9 | from ..testing import PathRequiredTestCase |
439 | 9 | 10 | ||
440 | 10 | 11 | ||
441 | 11 | class pkgme_info_tests(TestCase, TestWithFixtures, PathRequiredTestCase): | 12 | class pkgme_info_tests(TestCase, PathRequiredTestCase): |
442 | 12 | 13 | ||
443 | 13 | def test_interprets_pkgmeinfo(self): | 14 | def test_interprets_pkgmeinfo(self): |
444 | 14 | dist = Distribution() | 15 | dist = Distribution() |
445 | @@ -26,8 +27,8 @@ | |||
446 | 26 | self.assertEqual([], cmd.pkgmeinfo) | 27 | self.assertEqual([], cmd.pkgmeinfo) |
447 | 27 | 28 | ||
448 | 28 | def test_provides_requested_information(self): | 29 | def test_provides_requested_information(self): |
451 | 29 | tempdir = self.useFixture(TempdirFixture()) | 30 | tempdir = self.useFixture(TempDir()).path |
452 | 30 | out_path = tempdir.abspath('output') | 31 | out_path = os.path.join(tempdir, 'output') |
453 | 31 | name = self.getUniqueString() | 32 | name = self.getUniqueString() |
454 | 32 | dist = Distribution(dict(name=name)) | 33 | dist = Distribution(dict(name=name)) |
455 | 33 | cmd = pkgme_info(dist) | 34 | cmd = pkgme_info(dist) |
456 | @@ -41,8 +42,8 @@ | |||
457 | 41 | self.assertEqual({"package_name": name}, output) | 42 | self.assertEqual({"package_name": name}, output) |
458 | 42 | 43 | ||
459 | 43 | def test_skips_unknown_info(self): | 44 | def test_skips_unknown_info(self): |
462 | 44 | tempdir = self.useFixture(TempdirFixture()) | 45 | tempdir = self.useFixture(TempDir()).path |
463 | 45 | out_path = tempdir.abspath("output") | 46 | out_path = os.path.join(tempdir, "output") |
464 | 46 | name = self.getUniqueString() | 47 | name = self.getUniqueString() |
465 | 47 | dist = Distribution(dict(name=name)) | 48 | dist = Distribution(dict(name=name)) |
466 | 48 | cmd = pkgme_info(dist) | 49 | cmd = pkgme_info(dist) |
467 | 49 | 50 | ||
468 | === modified file 'pkgme/tests/test_info_elements.py' | |||
469 | --- pkgme/tests/test_info_elements.py 2012-08-21 15:13:44 +0000 | |||
470 | +++ pkgme/tests/test_info_elements.py 2012-09-04 15:26:25 +0000 | |||
471 | @@ -3,7 +3,7 @@ | |||
472 | 3 | from fixtures import EnvironmentVariableFixture | 3 | from fixtures import EnvironmentVariableFixture |
473 | 4 | from testtools import TestCase | 4 | from testtools import TestCase |
474 | 5 | 5 | ||
476 | 6 | from pkgme.info_elements import ( | 6 | from ..info_elements import ( |
477 | 7 | BuildDepends, | 7 | BuildDepends, |
478 | 8 | debian_formatted_text, | 8 | debian_formatted_text, |
479 | 9 | Description, | 9 | Description, |
480 | @@ -16,7 +16,7 @@ | |||
481 | 16 | MissingInfoError, | 16 | MissingInfoError, |
482 | 17 | PackageName, | 17 | PackageName, |
483 | 18 | ) | 18 | ) |
485 | 19 | from pkgme.project_info import DictInfo | 19 | from ..project_info import DictInfo |
486 | 20 | 20 | ||
487 | 21 | 21 | ||
488 | 22 | class TestElement(InfoElement): | 22 | class TestElement(InfoElement): |
489 | 23 | 23 | ||
490 | === modified file 'pkgme/tests/test_main.py' | |||
491 | --- pkgme/tests/test_main.py 2012-08-31 10:28:27 +0000 | |||
492 | +++ pkgme/tests/test_main.py 2012-09-04 15:26:25 +0000 | |||
493 | @@ -1,12 +1,12 @@ | |||
494 | 1 | from testtools import TestCase | 1 | from testtools import TestCase |
495 | 2 | 2 | ||
498 | 3 | from pkgme import __version__ | 3 | from .. import __version__ |
499 | 4 | from pkgme.backend import ( | 4 | from ..backend import ( |
500 | 5 | EXTERNAL_BACKEND_PATHS, | 5 | EXTERNAL_BACKEND_PATHS, |
501 | 6 | StaticBackend, | 6 | StaticBackend, |
502 | 7 | ) | 7 | ) |
505 | 8 | from pkgme.bin.main import get_version_info | 8 | from ..bin.main import get_version_info |
506 | 9 | from pkgme.testing import StaticLoaderFixture | 9 | from ..testing import StaticLoaderFixture |
507 | 10 | 10 | ||
508 | 11 | 11 | ||
509 | 12 | class TestVersionInfo(TestCase): | 12 | class TestVersionInfo(TestCase): |
510 | 13 | 13 | ||
511 | === modified file 'pkgme/tests/test_package_files.py' | |||
512 | --- pkgme/tests/test_package_files.py 2012-08-21 15:26:20 +0000 | |||
513 | +++ pkgme/tests/test_package_files.py 2012-09-04 15:26:25 +0000 | |||
514 | @@ -5,8 +5,9 @@ | |||
515 | 5 | from debian import changelog | 5 | from debian import changelog |
516 | 6 | from testtools import TestCase | 6 | from testtools import TestCase |
517 | 7 | from testtools.matchers import StartsWith | 7 | from testtools.matchers import StartsWith |
518 | 8 | from treeshape import FileTree | ||
519 | 8 | 9 | ||
521 | 9 | from pkgme.info_elements import ( | 10 | from ..info_elements import ( |
522 | 10 | Architecture, | 11 | Architecture, |
523 | 11 | ApplicationName, | 12 | ApplicationName, |
524 | 12 | BuildDepends, | 13 | BuildDepends, |
525 | @@ -32,7 +33,7 @@ | |||
526 | 32 | Version, | 33 | Version, |
527 | 33 | WorkingDirectory, | 34 | WorkingDirectory, |
528 | 34 | ) | 35 | ) |
530 | 35 | from pkgme.package_files import ( | 36 | from ..package_files import ( |
531 | 36 | BasicFile, | 37 | BasicFile, |
532 | 37 | Changelog, | 38 | Changelog, |
533 | 38 | Compat, | 39 | Compat, |
534 | @@ -46,14 +47,13 @@ | |||
535 | 46 | Rules, | 47 | Rules, |
536 | 47 | TemplatePackageFile, | 48 | TemplatePackageFile, |
537 | 48 | ) | 49 | ) |
540 | 49 | from pkgme.project_info import DictInfo | 50 | from ..project_info import DictInfo |
541 | 50 | from pkgme.testing import ( | 51 | from ..testing import ( |
542 | 51 | AreDesktopValuesFor, | 52 | AreDesktopValuesFor, |
543 | 52 | ControlStanzaHasField, | 53 | ControlStanzaHasField, |
544 | 53 | ControlStanzaDoesntHaveField, | 54 | ControlStanzaDoesntHaveField, |
545 | 54 | ControlSourceStanzaHasField, | 55 | ControlSourceStanzaHasField, |
546 | 55 | ControlSourceStanzaDoesntHaveField, | 56 | ControlSourceStanzaDoesntHaveField, |
547 | 56 | TempdirFixture, | ||
548 | 57 | ) | 57 | ) |
549 | 58 | 58 | ||
550 | 59 | 59 | ||
551 | @@ -610,21 +610,19 @@ | |||
552 | 610 | self.assertEqual(True, foo.overwrite) | 610 | self.assertEqual(True, foo.overwrite) |
553 | 611 | 611 | ||
554 | 612 | def test_extra_files_from_paths(self): | 612 | def test_extra_files_from_paths(self): |
562 | 613 | tempdir = self.useFixture(TempdirFixture()) | 613 | foo_content = self.getUniqueString() |
563 | 614 | filename1 = 'foo' | 614 | tree = self.useFixture( |
564 | 615 | filename2 = 'bar' | 615 | FileTree( |
565 | 616 | content1 = 'This is foo' | 616 | {'foo': {'content': foo_content}, |
566 | 617 | content2 = 'This is bar' | 617 | 'bar': {}})) |
560 | 618 | tempdir.create_file(filename1, content1) | ||
561 | 619 | tempdir.create_file(filename2, content2) | ||
567 | 620 | group = PackageFileGroup() | 618 | group = PackageFileGroup() |
568 | 621 | project_info = DictInfo({ | 619 | project_info = DictInfo({ |
569 | 622 | ExtraFilesFromPaths.name: { | 620 | ExtraFilesFromPaths.name: { |
572 | 623 | 'foo.txt': tempdir.abspath(filename1), | 621 | 'foo.txt': tree.join('foo'), |
573 | 624 | 'debian/install': tempdir.abspath(filename2), | 622 | 'debian/install': tree.join('bar'), |
574 | 625 | }}) | 623 | }}) |
575 | 626 | files = group.get_files(project_info) | 624 | files = group.get_files(project_info) |
576 | 627 | [foo, install] = files | 625 | [foo, install] = files |
577 | 628 | self.assertEqual('foo.txt', foo.path) | 626 | self.assertEqual('foo.txt', foo.path) |
579 | 629 | self.assertEqual(content1, foo.get_contents()) | 627 | self.assertEqual(foo_content, foo.get_contents()) |
580 | 630 | self.assertEqual(True, foo.overwrite) | 628 | self.assertEqual(True, foo.overwrite) |
581 | 631 | 629 | ||
582 | === modified file 'pkgme/tests/test_project_info.py' | |||
583 | --- pkgme/tests/test_project_info.py 2011-10-31 18:15:27 +0000 | |||
584 | +++ pkgme/tests/test_project_info.py 2012-09-04 15:26:25 +0000 | |||
585 | @@ -1,24 +1,24 @@ | |||
586 | 1 | import json | 1 | import json |
587 | 2 | import sys | 2 | import sys |
588 | 3 | 3 | ||
590 | 4 | from fixtures import TestWithFixtures | 4 | from fixtures import TempDir |
591 | 5 | from testtools import TestCase | 5 | from testtools import TestCase |
592 | 6 | from treeshape import ( | ||
593 | 7 | CONTENT, | ||
594 | 8 | FileTree, | ||
595 | 9 | PERMISSIONS, | ||
596 | 10 | ) | ||
597 | 6 | 11 | ||
599 | 7 | from pkgme.project_info import ( | 12 | from ..project_info import ( |
600 | 8 | DictInfo, | 13 | DictInfo, |
601 | 9 | FallbackInfo, | 14 | FallbackInfo, |
602 | 10 | MultipleExternalHelpersInfo, | 15 | MultipleExternalHelpersInfo, |
603 | 11 | SingleExternalHelperInfo, | 16 | SingleExternalHelperInfo, |
604 | 12 | ) | 17 | ) |
606 | 13 | from pkgme.run_script import ( | 18 | from ..run_script import ( |
607 | 14 | ScriptFailed, | 19 | ScriptFailed, |
608 | 15 | ScriptPermissionDenied, | 20 | ScriptPermissionDenied, |
609 | 16 | ) | 21 | ) |
610 | 17 | from pkgme.testing import ( | ||
611 | 18 | ExecutableFileFixture, | ||
612 | 19 | FileFixture, | ||
613 | 20 | TempdirFixture, | ||
614 | 21 | ) | ||
615 | 22 | 22 | ||
616 | 23 | 23 | ||
617 | 24 | class DictInfoTests(TestCase): | 24 | class DictInfoTests(TestCase): |
618 | @@ -81,70 +81,70 @@ | |||
619 | 81 | self.assertEqual({key: value1}, info.get_all([key])) | 81 | self.assertEqual({key: value1}, info.get_all([key])) |
620 | 82 | 82 | ||
621 | 83 | 83 | ||
623 | 84 | class MultipleExternalHelpersInfoTests(TestCase, TestWithFixtures): | 84 | class MultipleExternalHelpersInfoTests(TestCase): |
624 | 85 | |||
625 | 86 | def make_script(self, name, contents, permission=0700): | ||
626 | 87 | return self.useFixture( | ||
627 | 88 | FileTree({name: {CONTENT: contents, | ||
628 | 89 | PERMISSIONS: permission}})).path | ||
629 | 85 | 90 | ||
630 | 86 | def test_missing_helper(self): | 91 | def test_missing_helper(self): |
633 | 87 | tempdir = self.useFixture(TempdirFixture()) | 92 | tempdir = self.useFixture(TempDir()).path |
634 | 88 | info = MultipleExternalHelpersInfo(tempdir.path, tempdir.path) | 93 | info = MultipleExternalHelpersInfo(tempdir, tempdir) |
635 | 89 | key = self.getUniqueString() | 94 | key = self.getUniqueString() |
636 | 90 | self.assertEqual({key: None}, info.get_all([key])) | 95 | self.assertEqual({key: None}, info.get_all([key])) |
637 | 91 | 96 | ||
638 | 92 | def test_uses_output(self): | 97 | def test_uses_output(self): |
639 | 93 | tempdir = self.useFixture(TempdirFixture()) | ||
640 | 94 | script_name = self.getUniqueString() | 98 | script_name = self.getUniqueString() |
641 | 95 | script_path = tempdir.abspath(script_name) | ||
642 | 96 | value = self.getUniqueString() | 99 | value = self.getUniqueString() |
643 | 97 | script = "#!/bin/sh\necho %s\n" % value | 100 | script = "#!/bin/sh\necho %s\n" % value |
646 | 98 | self.useFixture(ExecutableFileFixture(script_path, script)) | 101 | tempdir = self.make_script(script_name, script) |
647 | 99 | info = MultipleExternalHelpersInfo(tempdir.path, tempdir.path) | 102 | info = MultipleExternalHelpersInfo(tempdir, tempdir) |
648 | 100 | self.assertEqual({script_name: value}, info.get_all([script_name])) | 103 | self.assertEqual({script_name: value}, info.get_all([script_name])) |
649 | 101 | 104 | ||
650 | 102 | def test_script_error(self): | 105 | def test_script_error(self): |
651 | 103 | tempdir = self.useFixture(TempdirFixture()) | ||
652 | 104 | script_name = self.getUniqueString() | 106 | script_name = self.getUniqueString() |
653 | 105 | script_path = tempdir.abspath(script_name) | ||
654 | 106 | script = "#!/bin/sh\nexit 1\n" | 107 | script = "#!/bin/sh\nexit 1\n" |
657 | 107 | self.useFixture(ExecutableFileFixture(script_path, script)) | 108 | tempdir = self.make_script(script_name, script) |
658 | 108 | info = MultipleExternalHelpersInfo(tempdir.path, tempdir.path) | 109 | info = MultipleExternalHelpersInfo(tempdir, tempdir) |
659 | 109 | self.assertRaises( | 110 | self.assertRaises( |
660 | 110 | ScriptFailed, info.get_all, [script_name]) | 111 | ScriptFailed, info.get_all, [script_name]) |
661 | 111 | 112 | ||
662 | 112 | def test_script_permission_denied(self): | 113 | def test_script_permission_denied(self): |
663 | 113 | """Check the exception raised when the info script isn't executable.""" | 114 | """Check the exception raised when the info script isn't executable.""" |
664 | 114 | tempdir = self.useFixture(TempdirFixture()) | ||
665 | 115 | script_name = self.getUniqueString() | 115 | script_name = self.getUniqueString() |
666 | 116 | script_path = tempdir.abspath(script_name) | ||
667 | 117 | script = "#!/bin/sh\nexit 0\n" | 116 | script = "#!/bin/sh\nexit 0\n" |
670 | 118 | self.useFixture(FileFixture(script_path, script)) | 117 | tempdir = self.make_script(script_name, script, 0644) |
671 | 119 | info = MultipleExternalHelpersInfo(tempdir.path, tempdir.path) | 118 | info = MultipleExternalHelpersInfo(tempdir, tempdir) |
672 | 120 | self.assertRaises( | 119 | self.assertRaises( |
673 | 121 | ScriptPermissionDenied, info.get_all, [script_name]) | 120 | ScriptPermissionDenied, info.get_all, [script_name]) |
674 | 122 | 121 | ||
675 | 123 | def test_correct_working_directory(self): | 122 | def test_correct_working_directory(self): |
678 | 124 | script_tempdir = self.useFixture(TempdirFixture()) | 123 | cwd_tempdir = self.useFixture(TempDir()).path |
677 | 125 | cwd_tempdir = self.useFixture(TempdirFixture()) | ||
679 | 126 | script_name = self.getUniqueString() | 124 | script_name = self.getUniqueString() |
680 | 127 | script_path = script_tempdir.abspath(script_name) | ||
681 | 128 | script = "#!%s\nimport os\nprint os.getcwd()\n" % sys.executable | 125 | script = "#!%s\nimport os\nprint os.getcwd()\n" % sys.executable |
685 | 129 | self.useFixture(ExecutableFileFixture(script_path, script)) | 126 | script_tempdir = self.make_script(script_name, script) |
686 | 130 | info = MultipleExternalHelpersInfo( | 127 | info = MultipleExternalHelpersInfo(script_tempdir, cwd_tempdir) |
684 | 131 | script_tempdir.path, cwd_tempdir.path) | ||
687 | 132 | self.assertEqual( | 128 | self.assertEqual( |
692 | 133 | {script_name: cwd_tempdir.path}, info.get_all([script_name])) | 129 | {script_name: cwd_tempdir}, info.get_all([script_name])) |
693 | 134 | 130 | ||
694 | 135 | 131 | ||
695 | 136 | class SingleExternalHelperInfoTests(TestCase, TestWithFixtures): | 132 | class SingleExternalHelperInfoTests(TestCase): |
696 | 133 | |||
697 | 134 | def make_script(self, contents, permission=0700): | ||
698 | 135 | name = SingleExternalHelperInfo.INFO_SCRIPT_NAME | ||
699 | 136 | return self.useFixture( | ||
700 | 137 | FileTree({name: {CONTENT: contents, | ||
701 | 138 | PERMISSIONS: permission}})) | ||
702 | 137 | 139 | ||
703 | 138 | def test_uses_output(self): | 140 | def test_uses_output(self): |
707 | 139 | tempdir = self.useFixture(TempdirFixture()) | 141 | element_name = self.getUniqueString() |
705 | 140 | script_name = self.getUniqueString() | ||
706 | 141 | script_path = tempdir.abspath(SingleExternalHelperInfo.INFO_SCRIPT_NAME) | ||
708 | 142 | value = self.getUniqueString() | 142 | value = self.getUniqueString() |
709 | 143 | script = '#!%s\nimport json\nprint json.dumps(%s)\n' % ( | 143 | script = '#!%s\nimport json\nprint json.dumps(%s)\n' % ( |
714 | 144 | sys.executable, json.dumps({script_name: value})) | 144 | sys.executable, json.dumps({element_name: value})) |
715 | 145 | self.useFixture(ExecutableFileFixture(script_path, script)) | 145 | tempdir = self.make_script(script).path |
716 | 146 | info = SingleExternalHelperInfo(tempdir.path, tempdir.path) | 146 | info = SingleExternalHelperInfo(tempdir, tempdir) |
717 | 147 | self.assertEqual({script_name: value}, info.get_all([script_name])) | 147 | self.assertEqual({element_name: value}, info.get_all([element_name])) |
718 | 148 | 148 | ||
719 | 149 | def test_when_script_gives_invalid_json_output(self): | 149 | def test_when_script_gives_invalid_json_output(self): |
720 | 150 | """Test when the script doesn't produce valid JSON. | 150 | """Test when the script doesn't produce valid JSON. |
721 | @@ -152,48 +152,42 @@ | |||
722 | 152 | As this is a problem with the backend we expect an AssertionError | 152 | As this is a problem with the backend we expect an AssertionError |
723 | 153 | with an intelligible message. | 153 | with an intelligible message. |
724 | 154 | """ | 154 | """ |
725 | 155 | tempdir = self.useFixture(TempdirFixture()) | ||
726 | 156 | script_path = tempdir.abspath(SingleExternalHelperInfo.INFO_SCRIPT_NAME) | ||
727 | 157 | value = self.getUniqueString() | ||
728 | 158 | script = '#!%s\nprint "}Nonsense"' % (sys.executable, ) | 155 | script = '#!%s\nprint "}Nonsense"' % (sys.executable, ) |
730 | 159 | self.useFixture(ExecutableFileFixture(script_path, script)) | 156 | tempdir = self.make_script(script) |
731 | 160 | info = SingleExternalHelperInfo(tempdir.path, tempdir.path) | 157 | info = SingleExternalHelperInfo(tempdir.path, tempdir.path) |
732 | 161 | e = self.assertRaises(AssertionError, info.get_all, []) | 158 | e = self.assertRaises(AssertionError, info.get_all, []) |
735 | 162 | self.assertEquals("%s didn't return valid JSON: '}Nonsense\\n'" | 159 | self.assertEquals( |
736 | 163 | % (script_path, ), str(e)) | 160 | "%s didn't return valid JSON: '}Nonsense\\n'" % ( |
737 | 161 | tempdir.join(SingleExternalHelperInfo.INFO_SCRIPT_NAME),), | ||
738 | 162 | str(e)) | ||
739 | 164 | 163 | ||
740 | 165 | def test_passes_input(self): | 164 | def test_passes_input(self): |
744 | 166 | tempdir = self.useFixture(TempdirFixture()) | 165 | element_name = self.getUniqueString() |
742 | 167 | script_name = self.getUniqueString() | ||
743 | 168 | script_path = tempdir.abspath(SingleExternalHelperInfo.INFO_SCRIPT_NAME) | ||
745 | 169 | value = self.getUniqueString() | 166 | value = self.getUniqueString() |
747 | 170 | script = """#!%s | 167 | script = """#!%(python)s |
748 | 171 | import json | 168 | import json |
749 | 172 | import sys | 169 | import sys |
750 | 173 | 170 | ||
751 | 174 | raw_input = sys.stdin.read() | 171 | raw_input = sys.stdin.read() |
752 | 175 | input = json.loads(raw_input) | 172 | input = json.loads(raw_input) |
755 | 176 | if input != ["%s"]: | 173 | if input != ["%(element)s"]: |
756 | 177 | print json.dumps({"%s": "Did not pass correct input: %%s" %% raw_input}) | 174 | print json.dumps({"%(element)s": "Did not pass correct input: %%s" %% raw_input}) |
757 | 178 | else: | 175 | else: |
763 | 179 | print json.dumps({"%s": "%s"}) | 176 | print json.dumps({"%(element)s": "%(value)s"}) |
764 | 180 | """ % (sys.executable, script_name, script_name, script_name, value) | 177 | """ % {'python': sys.executable, 'element': element_name, 'value': value} |
765 | 181 | self.useFixture(ExecutableFileFixture(script_path, script)) | 178 | tempdir = self.make_script(script).path |
766 | 182 | info = SingleExternalHelperInfo(tempdir.path, tempdir.path) | 179 | info = SingleExternalHelperInfo(tempdir, tempdir) |
767 | 183 | self.assertEqual({script_name: value}, info.get_all([script_name])) | 180 | self.assertEqual({element_name: value}, info.get_all([element_name])) |
768 | 184 | 181 | ||
769 | 185 | def test_correct_working_directory(self): | 182 | def test_correct_working_directory(self): |
774 | 186 | script_tempdir = self.useFixture(TempdirFixture()) | 183 | cwd_tempdir = self.useFixture(TempDir()) |
775 | 187 | cwd_tempdir = self.useFixture(TempdirFixture()) | 184 | element_name = self.getUniqueString() |
772 | 188 | script_name = self.getUniqueString() | ||
773 | 189 | script_path = script_tempdir.abspath(SingleExternalHelperInfo.INFO_SCRIPT_NAME) | ||
776 | 190 | script = """#!%s | 185 | script = """#!%s |
777 | 191 | import os | 186 | import os |
778 | 192 | import json | 187 | import json |
779 | 193 | print json.dumps({"%s": os.getcwd()}) | 188 | print json.dumps({"%s": os.getcwd()}) |
784 | 194 | """ % (sys.executable, script_name) | 189 | """ % (sys.executable, element_name) |
785 | 195 | self.useFixture(ExecutableFileFixture(script_path, script)) | 190 | script_tempdir = self.make_script(script).path |
786 | 196 | info = SingleExternalHelperInfo( | 191 | info = SingleExternalHelperInfo(script_tempdir, cwd_tempdir.path) |
783 | 197 | script_tempdir.path, cwd_tempdir.path) | ||
787 | 198 | self.assertEqual( | 192 | self.assertEqual( |
789 | 199 | {script_name: cwd_tempdir.path}, info.get_all([script_name])) | 193 | {element_name: cwd_tempdir.path}, info.get_all([element_name])) |
790 | 200 | 194 | ||
791 | === modified file 'pkgme/tests/test_python_backend.py' | |||
792 | --- pkgme/tests/test_python_backend.py 2012-09-03 10:42:06 +0000 | |||
793 | +++ pkgme/tests/test_python_backend.py 2012-09-04 15:26:25 +0000 | |||
794 | @@ -1,33 +1,32 @@ | |||
795 | 1 | from fixtures import TestWithFixtures | ||
796 | 2 | from testtools import TestCase | 1 | from testtools import TestCase |
797 | 2 | from treeshape import FileTree | ||
798 | 3 | 3 | ||
801 | 4 | from pkgme.backend import ExternalHelpersBackend, get_backend_dir | 4 | from ..backend import ExternalHelpersBackend, get_backend_dir |
800 | 5 | from pkgme.testing import TempdirFixture | ||
802 | 6 | 5 | ||
803 | 7 | 6 | ||
804 | 8 | backend_dir = get_backend_dir(__file__, 'python') | 7 | backend_dir = get_backend_dir(__file__, 'python') |
805 | 9 | 8 | ||
806 | 10 | 9 | ||
808 | 11 | class PythonBackendTests(TestCase, TestWithFixtures): | 10 | class PythonBackendTests(TestCase): |
809 | 12 | 11 | ||
810 | 13 | def test_want_with_setup_py(self): | 12 | def test_want_with_setup_py(self): |
813 | 14 | tempdir = self.useFixture(TempdirFixture()) | 13 | tempdir = self.useFixture(FileTree({'setup.py': {}})) |
812 | 15 | tempdir.touch('setup.py') | ||
814 | 16 | backend = ExternalHelpersBackend("python", backend_dir) | 14 | backend = ExternalHelpersBackend("python", backend_dir) |
815 | 17 | self.assertEqual((20, None), backend.want(tempdir.path)) | 15 | self.assertEqual((20, None), backend.want(tempdir.path)) |
816 | 18 | 16 | ||
817 | 19 | def test_want_without_setup_py(self): | 17 | def test_want_without_setup_py(self): |
819 | 20 | tempdir = self.useFixture(TempdirFixture()) | 18 | tempdir = self.useFixture(FileTree({})) |
820 | 21 | backend = ExternalHelpersBackend("python", backend_dir) | 19 | backend = ExternalHelpersBackend("python", backend_dir) |
821 | 22 | self.assertEqual( | 20 | self.assertEqual( |
822 | 23 | (0, "Couldn't find a setup.py"), backend.want(tempdir.path)) | 21 | (0, "Couldn't find a setup.py"), backend.want(tempdir.path)) |
823 | 24 | 22 | ||
824 | 25 | def test_all_info(self): | 23 | def test_all_info(self): |
827 | 26 | tempdir = self.useFixture(TempdirFixture()) | 24 | tempdir = self.useFixture( |
828 | 27 | tempdir.create_file('setup.py', """from distutils.core import setup | 25 | FileTree({'setup.py': {'content': """\ |
829 | 26 | from distutils.core import setup | ||
830 | 28 | 27 | ||
831 | 29 | setup(name="foo") | 28 | setup(name="foo") |
833 | 30 | """) | 29 | """}})) |
834 | 31 | backend = ExternalHelpersBackend("python", backend_dir) | 30 | backend = ExternalHelpersBackend("python", backend_dir) |
835 | 32 | info = backend.get_info(tempdir.path) | 31 | info = backend.get_info(tempdir.path) |
836 | 33 | info = info.get_all(['package_name']) | 32 | info = info.get_all(['package_name']) |
837 | 34 | 33 | ||
838 | === modified file 'pkgme/tests/test_run_script.py' | |||
839 | --- pkgme/tests/test_run_script.py 2012-08-22 13:37:48 +0000 | |||
840 | +++ pkgme/tests/test_run_script.py 2012-09-04 15:26:25 +0000 | |||
841 | @@ -2,7 +2,7 @@ | |||
842 | 2 | 2 | ||
843 | 3 | from testtools import TestCase | 3 | from testtools import TestCase |
844 | 4 | 4 | ||
846 | 5 | from pkgme.run_script import ( | 5 | from ..run_script import ( |
847 | 6 | ScriptFailed, | 6 | ScriptFailed, |
848 | 7 | ScriptUserError, | 7 | ScriptUserError, |
849 | 8 | ) | 8 | ) |
850 | 9 | 9 | ||
851 | === modified file 'pkgme/tests/test_script.py' | |||
852 | --- pkgme/tests/test_script.py 2012-09-04 15:17:02 +0000 | |||
853 | +++ pkgme/tests/test_script.py 2012-09-04 15:26:25 +0000 | |||
854 | @@ -13,16 +13,13 @@ | |||
855 | 13 | DirExists, | 13 | DirExists, |
856 | 14 | Not, | 14 | Not, |
857 | 15 | ) | 15 | ) |
858 | 16 | from treeshape import FileTree | ||
859 | 16 | 17 | ||
860 | 17 | from ..api import ( | 18 | from ..api import ( |
861 | 18 | get_all_info, | 19 | get_all_info, |
862 | 19 | load_backends, | 20 | load_backends, |
863 | 20 | packaging_info_as_data, | 21 | packaging_info_as_data, |
864 | 21 | ) | 22 | ) |
865 | 22 | from ..backend import StaticBackend | ||
866 | 23 | from ..info_elements import PackageName | ||
867 | 24 | from ..project_info import DictInfo | ||
868 | 25 | from ..testing import TempdirFixture | ||
869 | 26 | 23 | ||
870 | 27 | 24 | ||
871 | 28 | class ScriptTests(TestCase): | 25 | class ScriptTests(TestCase): |
872 | @@ -54,23 +51,21 @@ | |||
873 | 54 | self.assertEqual('', stderr.getvalue()) | 51 | self.assertEqual('', stderr.getvalue()) |
874 | 55 | return stdout.getvalue() | 52 | return stdout.getvalue() |
875 | 56 | 53 | ||
877 | 57 | def create_marker_file(self, tempdir, prefix=None): | 54 | def create_marker_file(self, prefix=None): |
878 | 58 | """Create the file that triggers the dummy backend for testing.""" | 55 | """Create the file that triggers the dummy backend for testing.""" |
879 | 59 | path = "is_pkgme_test" | 56 | path = "is_pkgme_test" |
880 | 60 | if prefix is not None: | 57 | if prefix is not None: |
881 | 61 | path = os.path.join(prefix, path) | 58 | path = os.path.join(prefix, path) |
883 | 62 | tempdir.create_file(path, "") | 59 | return self.useFixture(FileTree({path: {}})) |
884 | 63 | 60 | ||
885 | 64 | def test_writes_files(self): | 61 | def test_writes_files(self): |
888 | 65 | tempdir = self.useFixture(TempdirFixture()) | 62 | tempdir = self.create_marker_file() |
887 | 66 | self.create_marker_file(tempdir) | ||
889 | 67 | self.run_script(tempdir.path) | 63 | self.run_script(tempdir.path) |
891 | 68 | self.assertThat(tempdir.abspath("debian"), DirExists()) | 64 | self.assertThat(tempdir.join("debian"), DirExists()) |
892 | 69 | 65 | ||
893 | 70 | def test_builds_source_package(self): | 66 | def test_builds_source_package(self): |
897 | 71 | tempdir = self.useFixture(TempdirFixture()) | 67 | tempdir = self.create_marker_file(prefix="foo") |
898 | 72 | self.create_marker_file(tempdir, prefix="foo") | 68 | self.run_script(tempdir.join('foo')) |
896 | 73 | self.run_script(tempdir.abspath('foo')) | ||
899 | 74 | self.assertThat(tempdir.path, DirContains( | 69 | self.assertThat(tempdir.path, DirContains( |
900 | 75 | ["foo_0.0.0.orig.tar.gz", | 70 | ["foo_0.0.0.orig.tar.gz", |
901 | 76 | "foo_0.0.0.debian.tar.gz", | 71 | "foo_0.0.0.debian.tar.gz", |
902 | @@ -81,31 +76,27 @@ | |||
903 | 81 | ])) | 76 | ])) |
904 | 82 | 77 | ||
905 | 83 | def test_nobuild_doesnt_builds_source_package(self): | 78 | def test_nobuild_doesnt_builds_source_package(self): |
909 | 84 | tempdir = self.useFixture(TempdirFixture()) | 79 | tempdir = self.create_marker_file(prefix="foo") |
910 | 85 | self.create_marker_file(tempdir, prefix="foo") | 80 | self.run_script(tempdir.join('foo'), ['--nobuild']) |
908 | 86 | self.run_script(tempdir.abspath('foo'), ['--nobuild']) | ||
911 | 87 | self.assertThat(tempdir.path, DirContains(["foo"])) | 81 | self.assertThat(tempdir.path, DirContains(["foo"])) |
912 | 88 | 82 | ||
913 | 89 | def test_which_backends(self): | 83 | def test_which_backends(self): |
916 | 90 | tempdir = self.useFixture(TempdirFixture()) | 84 | tempdir = self.create_marker_file() |
915 | 91 | self.create_marker_file(tempdir) | ||
917 | 92 | output = self.run_script(tempdir.path, ['--which-backends']) | 85 | output = self.run_script(tempdir.path, ['--which-backends']) |
918 | 93 | self.assertEqual('dummy (100)\n', output) | 86 | self.assertEqual('dummy (100)\n', output) |
920 | 94 | self.assertThat(tempdir.abspath("debian"), Not(DirExists())) | 87 | self.assertThat(tempdir.join("debian"), Not(DirExists())) |
921 | 95 | 88 | ||
922 | 96 | def test_dump(self): | 89 | def test_dump(self): |
925 | 97 | tempdir = self.useFixture(TempdirFixture()) | 90 | tempdir = self.create_marker_file() |
924 | 98 | self.create_marker_file(tempdir) | ||
926 | 99 | all_info = get_all_info(tempdir.path, load_backends()) | 91 | all_info = get_all_info(tempdir.path, load_backends()) |
927 | 100 | clean_info = packaging_info_as_data(all_info) | 92 | clean_info = packaging_info_as_data(all_info) |
928 | 101 | output = self.run_script(tempdir.path, ['--dump']) | 93 | output = self.run_script(tempdir.path, ['--dump']) |
929 | 102 | self.assertEqual(clean_info, json.loads(output)) | 94 | self.assertEqual(clean_info, json.loads(output)) |
931 | 103 | self.assertThat(tempdir.abspath("debian"), Not(DirExists())) | 95 | self.assertThat(tempdir.join("debian"), Not(DirExists())) |
932 | 104 | 96 | ||
933 | 105 | def test_nosign(self): | 97 | def test_nosign(self): |
937 | 106 | tempdir = self.useFixture(TempdirFixture()) | 98 | tempdir = self.create_marker_file(prefix='foo') |
938 | 107 | self.create_marker_file(tempdir, prefix='foo') | 99 | self.run_script(tempdir.join('foo'), ['--nosign']) |
936 | 108 | self.run_script(tempdir.abspath('foo'), ['--nosign']) | ||
939 | 109 | changes_file = os.path.join(tempdir.path, | 100 | changes_file = os.path.join(tempdir.path, |
940 | 110 | "foo_0.0.0_source.changes") | 101 | "foo_0.0.0_source.changes") |
941 | 111 | signature = open(changes_file) | 102 | signature = open(changes_file) |
942 | 112 | 103 | ||
943 | === modified file 'pkgme/tests/test_template_file.py' | |||
944 | --- pkgme/tests/test_template_file.py 2010-11-05 20:29:46 +0000 | |||
945 | +++ pkgme/tests/test_template_file.py 2012-09-04 15:26:25 +0000 | |||
946 | @@ -1,6 +1,6 @@ | |||
947 | 1 | from testtools import TestCase | 1 | from testtools import TestCase |
948 | 2 | 2 | ||
950 | 3 | from pkgme.template_file import TemplateFile | 3 | from ..template_file import TemplateFile |
951 | 4 | 4 | ||
952 | 5 | 5 | ||
953 | 6 | class TemplateFileTests(TestCase): | 6 | class TemplateFileTests(TestCase): |
954 | 7 | 7 | ||
955 | === modified file 'pkgme/tests/test_testing.py' | |||
956 | --- pkgme/tests/test_testing.py 2012-08-06 13:26:01 +0000 | |||
957 | +++ pkgme/tests/test_testing.py 2012-09-04 15:26:25 +0000 | |||
958 | @@ -6,7 +6,7 @@ | |||
959 | 6 | FileContains, | 6 | FileContains, |
960 | 7 | ) | 7 | ) |
961 | 8 | 8 | ||
963 | 9 | from pkgme.testing import ( | 9 | from ..testing import ( |
964 | 10 | TempdirFixture, | 10 | TempdirFixture, |
965 | 11 | ) | 11 | ) |
966 | 12 | 12 | ||
967 | 13 | 13 | ||
968 | === modified file 'pkgme/tests/test_trace.py' | |||
969 | --- pkgme/tests/test_trace.py 2012-01-19 12:18:32 +0000 | |||
970 | +++ pkgme/tests/test_trace.py 2012-09-04 15:26:25 +0000 | |||
971 | @@ -1,11 +1,14 @@ | |||
972 | 1 | import os | 1 | import os |
973 | 2 | 2 | ||
975 | 3 | from fixtures import EnvironmentVariableFixture | 3 | from fixtures import ( |
976 | 4 | EnvironmentVariableFixture, | ||
977 | 5 | TempDir, | ||
978 | 6 | TempHomeDir, | ||
979 | 7 | ) | ||
980 | 4 | from testtools import TestCase | 8 | from testtools import TestCase |
981 | 5 | from testtools.matchers import MatchesRegex | 9 | from testtools.matchers import MatchesRegex |
982 | 6 | 10 | ||
985 | 7 | from pkgme.testing import TempdirFixture | 11 | from .. import trace |
984 | 8 | from pkgme import trace | ||
986 | 9 | 12 | ||
987 | 10 | 13 | ||
988 | 11 | _date_time_re = r'\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d,\d\d\d' | 14 | _date_time_re = r'\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d,\d\d\d' |
989 | @@ -13,9 +16,7 @@ | |||
990 | 13 | class TestLogging(TestCase): | 16 | class TestLogging(TestCase): |
991 | 14 | 17 | ||
992 | 15 | def with_temp_home(self): | 18 | def with_temp_home(self): |
996 | 16 | temp_dir = self.useFixture(TempdirFixture()) | 19 | return self.useFixture(TempHomeDir()) |
994 | 17 | self.useFixture(EnvironmentVariableFixture('HOME', temp_dir.path)) | ||
995 | 18 | return temp_dir | ||
997 | 19 | 20 | ||
998 | 20 | def with_temp_log(self): | 21 | def with_temp_log(self): |
999 | 21 | self.with_temp_home() | 22 | self.with_temp_home() |
1000 | @@ -31,8 +32,8 @@ | |||
1001 | 31 | 32 | ||
1002 | 32 | def test_log_location_from_env_var(self): | 33 | def test_log_location_from_env_var(self): |
1003 | 33 | # If PKGME_LOG_DIR is set in the environment we log there. | 34 | # If PKGME_LOG_DIR is set in the environment we log there. |
1006 | 34 | temp_home = self.with_temp_home() | 35 | self.with_temp_home() |
1007 | 35 | temp_dir = self.useFixture(TempdirFixture()) | 36 | temp_dir = self.useFixture(TempDir()) |
1008 | 36 | self.useFixture(EnvironmentVariableFixture('PKGME_LOG_DIR', temp_dir.path)) | 37 | self.useFixture(EnvironmentVariableFixture('PKGME_LOG_DIR', temp_dir.path)) |
1009 | 37 | log_location = trace.get_log_location() | 38 | log_location = trace.get_log_location() |
1010 | 38 | self.assertEqual(os.path.join(temp_dir.path, 'pkgme.log'), log_location) | 39 | self.assertEqual(os.path.join(temp_dir.path, 'pkgme.log'), log_location) |
1011 | 39 | 40 | ||
1012 | === modified file 'pkgme/tests/test_upload.py' | |||
1013 | --- pkgme/tests/test_upload.py 2011-08-01 18:11:44 +0000 | |||
1014 | +++ pkgme/tests/test_upload.py 2012-09-04 15:26:25 +0000 | |||
1015 | @@ -1,6 +1,6 @@ | |||
1016 | 1 | from testtools import TestCase | 1 | from testtools import TestCase |
1017 | 2 | 2 | ||
1019 | 3 | from pkgme.upload import ( | 3 | from ..upload import ( |
1020 | 4 | CannotUpload, | 4 | CannotUpload, |
1021 | 5 | InvalidPPAName, | 5 | InvalidPPAName, |
1022 | 6 | NoSuchPerson, | 6 | NoSuchPerson, |
1023 | 7 | 7 | ||
1024 | === modified file 'pkgme/tests/test_vala_backend.py' | |||
1025 | --- pkgme/tests/test_vala_backend.py 2012-04-27 14:45:31 +0000 | |||
1026 | +++ pkgme/tests/test_vala_backend.py 2012-09-04 15:26:25 +0000 | |||
1027 | @@ -18,116 +18,108 @@ | |||
1028 | 18 | # Authors: Michael Terry <michael.terry@canonical.com> | 18 | # Authors: Michael Terry <michael.terry@canonical.com> |
1029 | 19 | # ===================================================================== | 19 | # ===================================================================== |
1030 | 20 | 20 | ||
1034 | 21 | import os | 21 | from fixtures import TempDir |
1032 | 22 | |||
1033 | 23 | from fixtures import TestWithFixtures | ||
1035 | 24 | from testtools import TestCase | 22 | from testtools import TestCase |
1036 | 23 | from treeshape import FileTree, from_rough_spec | ||
1037 | 25 | 24 | ||
1040 | 26 | from pkgme.backend import ExternalHelpersBackend, get_backend_dir | 25 | from ..backend import ExternalHelpersBackend, get_backend_dir |
1041 | 27 | from pkgme.testing import CommandRequiredTestCase, TempdirFixture | 26 | from ..testing import CommandRequiredTestCase |
1042 | 28 | 27 | ||
1043 | 29 | 28 | ||
1044 | 30 | backend_dir = get_backend_dir(__file__, 'vala') | 29 | backend_dir = get_backend_dir(__file__, 'vala') |
1045 | 31 | 30 | ||
1046 | 32 | 31 | ||
1048 | 33 | class ValaBackendTests(TestCase, TestWithFixtures, CommandRequiredTestCase): | 32 | class ValaBackendTests(TestCase, CommandRequiredTestCase): |
1049 | 34 | 33 | ||
1053 | 35 | def setUp(self): | 34 | def make_tree(self, *spec): |
1054 | 36 | super(ValaBackendTests, self).setUp() | 35 | return self.useFixture(FileTree(from_rough_spec(spec))) |
1052 | 37 | self.tempdir = self.useFixture(TempdirFixture()) | ||
1055 | 38 | 36 | ||
1056 | 39 | def get_backend(self): | 37 | def get_backend(self): |
1057 | 40 | return ExternalHelpersBackend("vala", backend_dir) | 38 | return ExternalHelpersBackend("vala", backend_dir) |
1058 | 41 | 39 | ||
1059 | 42 | def get_info(self): | ||
1060 | 43 | backend = self.get_backend() | ||
1061 | 44 | return backend.get_info(self.tempdir.path) | ||
1062 | 45 | |||
1063 | 46 | def test_want_zero_deep(self): | 40 | def test_want_zero_deep(self): |
1066 | 47 | self.tempdir.create_file("configure.ac", "") | 41 | tempdir = self.make_tree('configure.ac', 'main.vala') |
1065 | 48 | self.tempdir.create_file("main.vala", "") | ||
1067 | 49 | backend = self.get_backend() | 42 | backend = self.get_backend() |
1069 | 50 | self.assertEqual((20, None), backend.want(self.tempdir.path)) | 43 | self.assertEqual((20, None), backend.want(tempdir.path)) |
1070 | 51 | 44 | ||
1071 | 52 | def test_want_one_deep(self): | 45 | def test_want_one_deep(self): |
1074 | 53 | self.tempdir.create_file("configure.ac", "") | 46 | tempdir = self.make_tree("configure.ac", "one/main.vala") |
1073 | 54 | self.tempdir.create_file(os.path.join("one", "main.vala"), "") | ||
1075 | 55 | backend = self.get_backend() | 47 | backend = self.get_backend() |
1077 | 56 | self.assertEqual((20, None), backend.want(self.tempdir.path)) | 48 | self.assertEqual((20, None), backend.want(tempdir.path)) |
1078 | 57 | 49 | ||
1079 | 58 | def test_want_two_deep(self): | 50 | def test_want_two_deep(self): |
1083 | 59 | self.tempdir.create_file("configure.ac", "") | 51 | tempdir = self.make_tree("configure.ac", "one/two/main.vala") |
1081 | 60 | self.tempdir.create_file( | ||
1082 | 61 | os.path.join("one", "two", "main.vala"), "") | ||
1084 | 62 | backend = self.get_backend() | 52 | backend = self.get_backend() |
1086 | 63 | self.assertEqual((0, None), backend.want(self.tempdir.path)) | 53 | self.assertEqual((0, None), backend.want(tempdir.path)) |
1087 | 64 | 54 | ||
1088 | 65 | def test_want_without_configure_ac(self): | 55 | def test_want_without_configure_ac(self): |
1090 | 66 | self.tempdir.create_file("main.vala", "") | 56 | tempdir = self.make_tree("main.vala") |
1091 | 67 | backend = self.get_backend() | 57 | backend = self.get_backend() |
1093 | 68 | self.assertEqual((0, None), backend.want(self.tempdir.path)) | 58 | self.assertEqual((0, None), backend.want(tempdir.path)) |
1094 | 69 | 59 | ||
1095 | 70 | def test_want_with_configure_in(self): | 60 | def test_want_with_configure_in(self): |
1098 | 71 | self.tempdir.create_file("configure.in", "") | 61 | tempdir = self.make_tree("main.vala", "configure.in") |
1097 | 72 | self.tempdir.create_file("main.vala", "") | ||
1099 | 73 | backend = self.get_backend() | 62 | backend = self.get_backend() |
1101 | 74 | self.assertEqual((20, None), backend.want(self.tempdir.path)) | 63 | self.assertEqual((20, None), backend.want(tempdir.path)) |
1102 | 75 | 64 | ||
1103 | 76 | def test_architecture(self): | 65 | def test_architecture(self): |
1105 | 77 | info = self.get_info() | 66 | tempdir = self.useFixture(TempDir()) |
1106 | 67 | info = self.get_backend().get_info(tempdir.path) | ||
1107 | 78 | self.assertEqual( | 68 | self.assertEqual( |
1108 | 79 | {"architecture": "any"}, info.get_all(["architecture"])) | 69 | {"architecture": "any"}, info.get_all(["architecture"])) |
1109 | 80 | 70 | ||
1110 | 81 | def test_buildsystem(self): | 71 | def test_buildsystem(self): |
1112 | 82 | info = self.get_info() | 72 | tempdir = self.useFixture(TempDir()) |
1113 | 73 | info = self.get_backend().get_info(tempdir.path) | ||
1114 | 83 | self.assertEqual( | 74 | self.assertEqual( |
1115 | 84 | {"buildsystem": "autoconf"}, info.get_all(["buildsystem"])) | 75 | {"buildsystem": "autoconf"}, info.get_all(["buildsystem"])) |
1116 | 85 | 76 | ||
1117 | 86 | def test_build_depends(self): | 77 | def test_build_depends(self): |
1118 | 87 | self.skipTestIfCommandNotExecutable('vala-dep-scanner') | 78 | self.skipTestIfCommandNotExecutable('vala-dep-scanner') |
1121 | 88 | self.tempdir.create_file("main.vala", "Gtk.Window win;") | 79 | tempdir = self.make_tree(("main.vala", "Gtk.Window win;")) |
1122 | 89 | info = self.get_info() | 80 | info = self.get_backend().get_info(tempdir.path) |
1123 | 90 | self.assertEqual( | 81 | self.assertEqual( |
1124 | 91 | {"build_depends": "libgtk3.0-dev, valac"}, | 82 | {"build_depends": "libgtk3.0-dev, valac"}, |
1125 | 92 | info.get_all(["build_depends"])) | 83 | info.get_all(["build_depends"])) |
1126 | 93 | 84 | ||
1127 | 94 | def test_depends(self): | 85 | def test_depends(self): |
1129 | 95 | info = self.get_info() | 86 | tempdir = self.useFixture(TempDir()) |
1130 | 87 | info = self.get_backend().get_info(tempdir.path) | ||
1131 | 96 | self.assertEqual( | 88 | self.assertEqual( |
1132 | 97 | {"depends": "${shlibs:Depends}"}, info.get_all(["depends"])) | 89 | {"depends": "${shlibs:Depends}"}, info.get_all(["depends"])) |
1133 | 98 | 90 | ||
1134 | 99 | def test_homepage(self): | 91 | def test_homepage(self): |
1140 | 100 | self.tempdir.create_file( | 92 | tempdir = self.make_tree( |
1141 | 101 | "configure.ac", | 93 | ("configure.ac", |
1142 | 102 | "AC_INIT([Example Project],[1.0],[http://bugs.example.com/]," | 94 | "AC_INIT([Example Project],[1.0],[http://bugs.example.com/]," |
1143 | 103 | "[example-project], [http://example.com/] )") | 95 | "[example-project], [http://example.com/] )")) |
1144 | 104 | info = self.get_info() | 96 | info = self.get_backend().get_info(tempdir.path) |
1145 | 105 | self.assertEqual( | 97 | self.assertEqual( |
1146 | 106 | {"homepage": "http://example.com/"}, info.get_all(["homepage"])) | 98 | {"homepage": "http://example.com/"}, info.get_all(["homepage"])) |
1147 | 107 | 99 | ||
1148 | 108 | def test_homepage_none(self): | 100 | def test_homepage_none(self): |
1154 | 109 | self.tempdir.create_file( | 101 | tempdir = self.make_tree( |
1155 | 110 | "configure.ac", | 102 | ("configure.ac", |
1156 | 111 | "AC_INIT([Example Project],[1.0],[http://bugs.example.com/]," | 103 | "AC_INIT([Example Project],[1.0],[http://bugs.example.com/]," |
1157 | 112 | "[example-project])") | 104 | "[example-project])")) |
1158 | 113 | info = self.get_info() | 105 | info = self.get_backend().get_info(tempdir.path) |
1159 | 114 | self.assertEqual( | 106 | self.assertEqual( |
1160 | 115 | {"homepage": ""}, info.get_all(["homepage"])) | 107 | {"homepage": ""}, info.get_all(["homepage"])) |
1161 | 116 | 108 | ||
1162 | 117 | def test_package_name(self): | 109 | def test_package_name(self): |
1168 | 118 | self.tempdir.create_file( | 110 | tempdir = self.make_tree( |
1169 | 119 | "configure.ac", | 111 | ("configure.ac", |
1170 | 120 | "AC_INIT([GNU Example Project],[1.0],[http://bugs.example.com/]," | 112 | "AC_INIT([GNU Example Project],[1.0],[http://bugs.example.com/]," |
1171 | 121 | "[co ol-proj],[http://example.com/])") | 113 | "[co ol-proj],[http://example.com/])")) |
1172 | 122 | info = self.get_info() | 114 | info = self.get_backend().get_info(tempdir.path) |
1173 | 123 | self.assertEqual( | 115 | self.assertEqual( |
1174 | 124 | {"package_name": "co ol-proj"}, info.get_all(["package_name"])) | 116 | {"package_name": "co ol-proj"}, info.get_all(["package_name"])) |
1175 | 125 | 117 | ||
1176 | 126 | def test_package_name_none(self): | 118 | def test_package_name_none(self): |
1182 | 127 | self.tempdir.create_file( | 119 | tempdir = self.make_tree( |
1183 | 128 | "configure.ac", | 120 | ("configure.ac", |
1184 | 129 | "AC_INIT( [GNU Example Project] , [1.0]," | 121 | "AC_INIT( [GNU Example Project] , [1.0]," |
1185 | 130 | "[http://bugs.example.com/])") | 122 | "[http://bugs.example.com/])")) |
1186 | 131 | info = self.get_info() | 123 | info = self.get_backend().get_info(tempdir.path) |
1187 | 132 | self.assertEqual( | 124 | self.assertEqual( |
1188 | 133 | {"package_name": "example-project"}, info.get_all(["package_name"])) | 125 | {"package_name": "example-project"}, info.get_all(["package_name"])) |
1189 | 134 | 126 | ||
1190 | === modified file 'pkgme/tests/test_write.py' | |||
1191 | --- pkgme/tests/test_write.py 2012-08-06 13:26:01 +0000 | |||
1192 | +++ pkgme/tests/test_write.py 2012-09-04 15:26:25 +0000 | |||
1193 | @@ -1,6 +1,6 @@ | |||
1194 | 1 | import os | 1 | import os |
1195 | 2 | 2 | ||
1197 | 3 | from fixtures import TestWithFixtures | 3 | from fixtures import TempDir |
1198 | 4 | from testtools import TestCase | 4 | from testtools import TestCase |
1199 | 5 | from testtools.matchers import ( | 5 | from testtools.matchers import ( |
1200 | 6 | DirExists, | 6 | DirExists, |
1201 | @@ -8,16 +8,17 @@ | |||
1202 | 8 | PathExists, | 8 | PathExists, |
1203 | 9 | ) | 9 | ) |
1204 | 10 | 10 | ||
1210 | 11 | from pkgme.package_files import PackageFile | 11 | from ..package_files import PackageFile |
1211 | 12 | from pkgme.testing import ( | 12 | from ..write import ( |
1207 | 13 | TempdirFixture, | ||
1208 | 14 | ) | ||
1209 | 15 | from pkgme.write import ( | ||
1212 | 16 | write_file, | 13 | write_file, |
1213 | 17 | Writer, | 14 | Writer, |
1214 | 18 | ) | 15 | ) |
1215 | 19 | 16 | ||
1216 | 20 | 17 | ||
1217 | 18 | def abspath(fixture, *segments): | ||
1218 | 19 | return os.path.join(fixture.path, *segments) | ||
1219 | 20 | |||
1220 | 21 | |||
1221 | 21 | class SimplePackageFile(PackageFile): | 22 | class SimplePackageFile(PackageFile): |
1222 | 22 | 23 | ||
1223 | 23 | def __init__(self, path, contents="", overwrite=True): | 24 | def __init__(self, path, contents="", overwrite=True): |
1224 | @@ -29,80 +30,80 @@ | |||
1225 | 29 | return self.contents | 30 | return self.contents |
1226 | 30 | 31 | ||
1227 | 31 | 32 | ||
1229 | 32 | class WriterTests(TestCase, TestWithFixtures): | 33 | class WriterTests(TestCase): |
1230 | 33 | 34 | ||
1231 | 34 | def get_writer(self): | 35 | def get_writer(self): |
1232 | 35 | return Writer() | 36 | return Writer() |
1233 | 36 | 37 | ||
1234 | 37 | def do_write(self, tempdir=None): | 38 | def do_write(self, tempdir=None): |
1235 | 38 | if tempdir is None: | 39 | if tempdir is None: |
1237 | 39 | tempdir = self.useFixture(TempdirFixture()) | 40 | tempdir = self.useFixture(TempDir()) |
1238 | 40 | writer = self.get_writer() | 41 | writer = self.get_writer() |
1239 | 41 | writer.write(tempdir.path) | 42 | writer.write(tempdir.path) |
1240 | 42 | return tempdir | 43 | return tempdir |
1241 | 43 | 44 | ||
1242 | 44 | def test_write_creates_target_dir(self): | 45 | def test_write_creates_target_dir(self): |
1243 | 45 | writer = self.get_writer() | 46 | writer = self.get_writer() |
1246 | 46 | tempdir = self.useFixture(TempdirFixture()) | 47 | tempdir = self.useFixture(TempDir()) |
1247 | 47 | target_dir = tempdir.abspath(self.getUniqueString()) | 48 | target_dir = abspath(tempdir, self.getUniqueString()) |
1248 | 48 | writer.write( | 49 | writer.write( |
1249 | 49 | [SimplePackageFile(self.getUniqueString())], target_dir) | 50 | [SimplePackageFile(self.getUniqueString())], target_dir) |
1250 | 50 | self.assertThat(target_dir, DirExists()) | 51 | self.assertThat(target_dir, DirExists()) |
1251 | 51 | 52 | ||
1252 | 52 | def test_write_creates_needed_subdirs(self): | 53 | def test_write_creates_needed_subdirs(self): |
1253 | 53 | writer = self.get_writer() | 54 | writer = self.get_writer() |
1255 | 54 | tempdir = self.useFixture(TempdirFixture()) | 55 | tempdir = self.useFixture(TempDir()) |
1256 | 55 | subdir = self.getUniqueString() | 56 | subdir = self.getUniqueString() |
1257 | 56 | package_file = SimplePackageFile( | 57 | package_file = SimplePackageFile( |
1258 | 57 | os.path.join(subdir, self.getUniqueString())) | 58 | os.path.join(subdir, self.getUniqueString())) |
1259 | 58 | writer.write([package_file], tempdir.path) | 59 | writer.write([package_file], tempdir.path) |
1261 | 59 | self.assertThat(tempdir.abspath(subdir), DirExists()) | 60 | self.assertThat(abspath(tempdir, subdir), DirExists()) |
1262 | 60 | 61 | ||
1263 | 61 | def test_write_accepts_existing_subdir(self): | 62 | def test_write_accepts_existing_subdir(self): |
1264 | 62 | writer = self.get_writer() | 63 | writer = self.get_writer() |
1266 | 63 | tempdir = self.useFixture(TempdirFixture()) | 64 | tempdir = self.useFixture(TempDir()) |
1267 | 64 | subdir = self.getUniqueString() | 65 | subdir = self.getUniqueString() |
1268 | 65 | package_file = SimplePackageFile( | 66 | package_file = SimplePackageFile( |
1269 | 66 | os.path.join(subdir, self.getUniqueString())) | 67 | os.path.join(subdir, self.getUniqueString())) |
1271 | 67 | os.makedirs(tempdir.abspath(subdir)) | 68 | os.makedirs(abspath(tempdir, subdir)) |
1272 | 68 | writer.write([package_file], tempdir.path) | 69 | writer.write([package_file], tempdir.path) |
1274 | 69 | self.assertThat(tempdir.abspath(subdir), DirExists()) | 70 | self.assertThat(abspath(tempdir, subdir), DirExists()) |
1275 | 70 | 71 | ||
1276 | 71 | def test_write_creates_file(self): | 72 | def test_write_creates_file(self): |
1277 | 72 | writer = self.get_writer() | 73 | writer = self.get_writer() |
1279 | 73 | tempdir = self.useFixture(TempdirFixture()) | 74 | tempdir = self.useFixture(TempDir()) |
1280 | 74 | filename = self.getUniqueString() | 75 | filename = self.getUniqueString() |
1281 | 75 | package_file = SimplePackageFile(filename) | 76 | package_file = SimplePackageFile(filename) |
1282 | 76 | writer.write([package_file], tempdir.path) | 77 | writer.write([package_file], tempdir.path) |
1284 | 77 | self.assertThat(tempdir.abspath(filename), PathExists()) | 78 | self.assertThat(abspath(tempdir, filename), PathExists()) |
1285 | 78 | 79 | ||
1286 | 79 | def test_write_creates_file_with_correct_contents(self): | 80 | def test_write_creates_file_with_correct_contents(self): |
1287 | 80 | writer = self.get_writer() | 81 | writer = self.get_writer() |
1289 | 81 | tempdir = self.useFixture(TempdirFixture()) | 82 | tempdir = self.useFixture(TempDir()) |
1290 | 82 | filename = self.getUniqueString() | 83 | filename = self.getUniqueString() |
1291 | 83 | contents = self.getUniqueString() | 84 | contents = self.getUniqueString() |
1292 | 84 | package_file = SimplePackageFile(filename, contents=contents) | 85 | package_file = SimplePackageFile(filename, contents=contents) |
1293 | 85 | writer.write([package_file], tempdir.path) | 86 | writer.write([package_file], tempdir.path) |
1295 | 86 | self.assertThat(tempdir.abspath(filename), FileContains(contents)) | 87 | self.assertThat(abspath(tempdir, filename), FileContains(contents)) |
1296 | 87 | 88 | ||
1297 | 88 | def test_write_creates_all_files(self): | 89 | def test_write_creates_all_files(self): |
1298 | 89 | writer = self.get_writer() | 90 | writer = self.get_writer() |
1300 | 90 | tempdir = self.useFixture(TempdirFixture()) | 91 | tempdir = self.useFixture(TempDir()) |
1301 | 91 | filename1 = self.getUniqueString() | 92 | filename1 = self.getUniqueString() |
1302 | 92 | package_file1 = SimplePackageFile(filename1) | 93 | package_file1 = SimplePackageFile(filename1) |
1303 | 93 | filename2 = self.getUniqueString() | 94 | filename2 = self.getUniqueString() |
1304 | 94 | package_file2 = SimplePackageFile(filename2) | 95 | package_file2 = SimplePackageFile(filename2) |
1305 | 95 | writer.write([package_file1, package_file2], tempdir.path) | 96 | writer.write([package_file1, package_file2], tempdir.path) |
1308 | 96 | self.assertThat(tempdir.abspath(filename1), PathExists()) | 97 | self.assertThat(abspath(tempdir, filename1), PathExists()) |
1309 | 97 | self.assertThat(tempdir.abspath(filename2), PathExists()) | 98 | self.assertThat(abspath(tempdir, filename2), PathExists()) |
1310 | 98 | 99 | ||
1311 | 99 | def test_write_overwrites(self): | 100 | def test_write_overwrites(self): |
1312 | 100 | writer = self.get_writer() | 101 | writer = self.get_writer() |
1314 | 101 | tempdir = self.useFixture(TempdirFixture()) | 102 | tempdir = self.useFixture(TempDir()) |
1315 | 102 | original_contents = self.getUniqueString() | 103 | original_contents = self.getUniqueString() |
1316 | 103 | new_contents = self.getUniqueString() | 104 | new_contents = self.getUniqueString() |
1317 | 104 | filename = self.getUniqueString() | 105 | filename = self.getUniqueString() |
1319 | 105 | target_path = tempdir.abspath(filename) | 106 | target_path = abspath(tempdir, filename) |
1320 | 106 | write_file(target_path, original_contents) | 107 | write_file(target_path, original_contents) |
1321 | 107 | package_file = SimplePackageFile( | 108 | package_file = SimplePackageFile( |
1322 | 108 | filename, contents=new_contents, overwrite=True) | 109 | filename, contents=new_contents, overwrite=True) |
1323 | @@ -111,11 +112,11 @@ | |||
1324 | 111 | 112 | ||
1325 | 112 | def test_write_doesnt_overwrite_files_with_overwrite_False(self): | 113 | def test_write_doesnt_overwrite_files_with_overwrite_False(self): |
1326 | 113 | writer = self.get_writer() | 114 | writer = self.get_writer() |
1328 | 114 | tempdir = self.useFixture(TempdirFixture()) | 115 | tempdir = self.useFixture(TempDir()) |
1329 | 115 | original_contents = self.getUniqueString() | 116 | original_contents = self.getUniqueString() |
1330 | 116 | new_contents = self.getUniqueString() | 117 | new_contents = self.getUniqueString() |
1331 | 117 | filename = self.getUniqueString() | 118 | filename = self.getUniqueString() |
1333 | 118 | target_path = tempdir.abspath(filename) | 119 | target_path = abspath(tempdir, filename) |
1334 | 119 | write_file(target_path, original_contents) | 120 | write_file(target_path, original_contents) |
1335 | 120 | package_file = SimplePackageFile( | 121 | package_file = SimplePackageFile( |
1336 | 121 | filename, contents=new_contents, overwrite=False) | 122 | filename, contents=new_contents, overwrite=False) |
1337 | @@ -124,10 +125,10 @@ | |||
1338 | 124 | 125 | ||
1339 | 125 | def test_write_encodes_unicode(self): | 126 | def test_write_encodes_unicode(self): |
1340 | 126 | writer = self.get_writer() | 127 | writer = self.get_writer() |
1342 | 127 | tempdir = self.useFixture(TempdirFixture()) | 128 | tempdir = self.useFixture(TempDir()) |
1343 | 128 | contents = u"\x80" | 129 | contents = u"\x80" |
1344 | 129 | filename = self.getUniqueString() | 130 | filename = self.getUniqueString() |
1346 | 130 | target_path = tempdir.abspath(filename) | 131 | target_path = abspath(tempdir, filename) |
1347 | 131 | package_file = SimplePackageFile(filename, contents=contents) | 132 | package_file = SimplePackageFile(filename, contents=contents) |
1348 | 132 | writer.write([package_file], tempdir.path) | 133 | writer.write([package_file], tempdir.path) |
1349 | 133 | self.assertThat(target_path, FileContains(contents.encode('utf-8'))) | 134 | self.assertThat(target_path, FileContains(contents.encode('utf-8'))) |
1350 | 134 | 135 | ||
1351 | === modified file 'versions.cfg' | |||
1352 | --- versions.cfg 2012-08-29 15:29:32 +0000 | |||
1353 | +++ versions.cfg 2012-09-04 15:26:25 +0000 | |||
1354 | @@ -26,7 +26,7 @@ | |||
1355 | 26 | simplejson = 2.6.1 | 26 | simplejson = 2.6.1 |
1356 | 27 | testresources = 0.2.5 | 27 | testresources = 0.2.5 |
1357 | 28 | testtools = 0.9.16 | 28 | testtools = 0.9.16 |
1359 | 29 | treeshape = 0.2.0 | 29 | treeshape = 0.2.1 |
1360 | 30 | wadllib = 1.3.1 | 30 | wadllib = 1.3.1 |
1361 | 31 | wsgi-intercept = 0.5.1 | 31 | wsgi-intercept = 0.5.1 |
1362 | 32 | z3c.recipe.scripts = 1.0.1 | 32 | z3c.recipe.scripts = 1.0.1 |
Looks good.
Thanks,
James