diff options
author | Guilherme Salgado <salgado@canonical.com> | 2010-12-08 14:49:44 -0200 |
---|---|---|
committer | Guilherme Salgado <salgado@canonical.com> | 2010-12-08 14:49:44 -0200 |
commit | 353921eb1fea138c7bab7936312f8ebe82cd57e5 (patch) | |
tree | 3257e16b80492e7c46910605b134f27120af63d9 /hwpack | |
parent | d28dec041f75c3a42870511119e4c75599faaa5b (diff) |
Port create_partitions to python
Diffstat (limited to 'hwpack')
-rw-r--r-- | hwpack/testing.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hwpack/testing.py b/hwpack/testing.py index 69f1feb..67398fe 100644 --- a/hwpack/testing.py +++ b/hwpack/testing.py @@ -159,6 +159,15 @@ class TestCaseWithFixtures(TestCase): fixture.setUp() return fixture + def createTempFileAsFixture(self, prefix='tmp'): + """Create a temp file and make sure it is removed on tearDown. + + :return: The filename of the file created. + """ + _, filename = tempfile.mkstemp(prefix=prefix) + self.addCleanup(os.unlink, filename) + return filename + class ConfigFileFixture(object): |