diff mbox

[Branch,~linaro-maintainers/linaro-image-tools/trunk] Rev 280: Merge lp:~lool/linaro-image-tools/temp-tarball; fixes warnings when running

Message ID 20110201172628.8143.80516.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Loïc Minier Feb. 1, 2011, 5:26 p.m. UTC
Merge authors:
  Loïc Minier (lool)
Related merge proposals:
  https://code.launchpad.net/~lool/linaro-image-tools/temp-tarball/+merge/48150
  proposed by: Loïc Minier (lool)
  review: Approve - James Westby (james-w)
------------------------------------------------------------
revno: 280 [merge]
committer: Loïc Minier <lool@dooz.org>
branch nick: linaro-image-tools
timestamp: Tue 2011-02-01 18:24:51 +0100
message:
  Merge lp:~lool/linaro-image-tools/temp-tarball; fixes warnings when running
  testsuite.
modified:
  linaro_media_create/tests/fixtures.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro_media_create/tests/fixtures.py'
--- linaro_media_create/tests/fixtures.py	2011-01-28 19:50:48 +0000
+++ linaro_media_create/tests/fixtures.py	2011-02-01 16:06:46 +0000
@@ -44,19 +44,24 @@ 
 
 class CreateTarballFixture(object):
 
-    def __init__(self, dir):
-        self.dir = dir
-        self.tarball = os.path.join(self.dir, 'tarball.tar.gz')
+    def __init__(self, basedir, reldir='tarball', filename='tarball.tar.gz'):
+        self.basedir = basedir
+        self.reldir = reldir
+        self.tarball = os.path.join(self.basedir, filename)
 
     def setUp(self):
         # Create gzipped tar archive.
-        args = ['tar', '-czf', self.tarball, self.dir]
+        os.mkdir(os.path.join(self.basedir, reldir))
+        args = ['tar', '-C', self.basedir, '-czf', self.tarball, self.reldir]
         proc = subprocess.Popen(args)
         proc.wait()
 
     def tearDown(self):
         if os.path.exists(self.tarball):
             os.remove(self.tarball)
+        dir = os.path.join(self.basedir, subdir)
+        if os.path.exists(dir):
+            os.rmdir(dir)
 
     def get_tarball(self):
         return self.tarball