diff options
Diffstat (limited to 'test/testlib/helper.py')
-rw-r--r-- | test/testlib/helper.py | 13 |
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 |