projects
/
tools
/
git-buildpackage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
932b1c0
)
testutils: create missing directories when adding a file
author
Guido Günther
<agx@sigxcpu.org>
Fri, 23 Nov 2012 17:24:32 +0000
(18:24 +0100)
committer
Guido Günther
<agx@sigxcpu.org>
Fri, 23 Nov 2012 17:24:32 +0000
(18:24 +0100)
tests/testutils.py
patch
|
blob
|
history
diff --git
a/tests/testutils.py
b/tests/testutils.py
index
74b1067
..
af243d5
100644
(file)
--- a/
tests/testutils.py
+++ b/
tests/testutils.py
@@
-7,7
+7,6
@@
import unittest
import gbp.log
import gbp.deb.git
import gbp.errors
-import gbp.scripts.buildpackage as buildpackage
class DebianGitTestRepo(unittest.TestCase):
"""Scratch repo for a single test"""
@@
-35,6
+34,11
@@
class DebianGitTestRepo(unittest.TestCase):
@type content: C{str}
"""
path = os.path.join(self.repo.path, name)
+
+ d = os.path.dirname(path)
+ if not os.path.exists(d):
+ os.makedirs(d)
+
with file(path, 'w+') as f:
content == None or f.write(content)
self.repo.add_files(name, force=True)