summaryrefslogtreecommitdiff
path: root/test/testlib/helper.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-27 11:58:20 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-10-27 11:58:20 +0100
commit22757ed7b58862cccef64fdc09f93ea1ac72b1d2 (patch)
tree943038de3caac80d35b774e33cb2899b2856bbdf /test/testlib/helper.py
parent2792e534dd55fe03bca302f87a3ea638a7278bf1 (diff)
downloadgitpython-22757ed7b58862cccef64fdc09f93ea1ac72b1d2.tar.gz
put _make_file helper method into TestBase class
remote: prepared FetchInfo class to be returned by fetch and pull. About to implement tests
Diffstat (limited to 'test/testlib/helper.py')
-rw-r--r--test/testlib/helper.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/testlib/helper.py b/test/testlib/helper.py
index ab4b9f4e..d541a111 100644
--- a/test/testlib/helper.py
+++ b/test/testlib/helper.py
@@ -175,4 +175,15 @@ class TestBase(TestCase):
each test type has its own repository
"""
cls.rorepo = Repo(GIT_REPO)
-
+
+ def _make_file(self, rela_path, data, repo=None):
+ """
+ Create a file at the given path relative to our repository, filled
+ with the given data. Returns absolute path to created file.
+ """
+ repo = repo or self.rorepo
+ abs_path = os.path.join(repo.git.git_dir, rela_path)
+ fp = open(abs_path, "w")
+ fp.write(data)
+ fp.close()
+ return abs_path