diff options
author | Michael Hudson <michael.hudson@linaro.org> | 2010-12-16 12:27:53 +1300 |
---|---|---|
committer | Michael Hudson <michael.hudson@linaro.org> | 2010-12-16 12:27:53 +1300 |
commit | 60ea2186fd5d27c48dcd2d5439f2779611cec824 (patch) | |
tree | 7d7ec390e25bd41dfeaae59c5dbbf131f901bb11 /hwpack | |
parent | 32d22f5f8d615b1d67c1cf759565e5f7bccd1a2a (diff) |
split TemporaryDirectoryManager out of PackageMaker, add LocalArchiveMaker
Diffstat (limited to 'hwpack')
-rw-r--r-- | hwpack/packages.py | 22 | ||||
-rw-r--r-- | hwpack/tests/test_packages.py | 10 |
2 files changed, 24 insertions, 8 deletions
diff --git a/hwpack/packages.py b/hwpack/packages.py index 1dfddd3..8ca7e51 100644 --- a/hwpack/packages.py +++ b/hwpack/packages.py @@ -126,13 +126,7 @@ class DummyProgress(object): pass -class PackageMaker(object): - """An object that can create binary debs on the fly. - - PackageMakers implement the context manager protocol to manage the - temporary directories the debs are created in. - """ - +class TemporaryDirectoryManager(object): def __init__(self): self._temporary_directories = None @@ -161,6 +155,20 @@ class PackageMaker(object): self._temporary_directories.append(tmpdir) return tmpdir + +class LocalArchiveMaker(TemporaryDirectoryManager): + + def sources_entry_for_debs(self, local_debs): + pass + + +class PackageMaker(TemporaryDirectoryManager): + """An object that can create binary debs on the fly. + + PackageMakers implement the context manager protocol to manage the + temporary directories the debs are created in. + """ + # This template (and the code that uses it) is made more awkward by the # fact that blank lines are invalid in control files -- so in particular # when there are no relationships, there must be no blank line between the diff --git a/hwpack/tests/test_packages.py b/hwpack/tests/test_packages.py index d0aedc4..b2107fd 100644 --- a/hwpack/tests/test_packages.py +++ b/hwpack/tests/test_packages.py @@ -202,7 +202,7 @@ class StringifyRelationshipTests(TestCaseWithFixtures): "baz (>= 2.0)", stringify_relationship(candidate, "Depends")) -class PackageMakerTests(TestCaseWithFixtures): +class TemporaryDirectoryManagerTests(TestCaseWithFixtures): def test_enter_twice_fails(self): maker = PackageMaker() @@ -230,6 +230,14 @@ class PackageMakerTests(TestCaseWithFixtures): maker.__exit__() self.assertFalse(os.path.isdir(tmpdir)) + +class LocalArchiveMakerTests(TestCaseWithFixtures): + + pass + + +class PackageMakerTests(TestCaseWithFixtures): + def test_make_package_creates_file(self): maker = PackageMaker() self.useFixture(ContextManagerFixture(maker)) |