summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-01-10 15:58:22 +0200
committerLars Wirzenius <liw@liw.fi>2024-01-10 17:38:05 +0200
commit20fab34125be3fd481a79122d2186b2151ebfa70 (patch)
tree349d3ca707b271e78da1d3621bca069e9d56329b
parenta8fc705087082ebbf433dc1ee6724396220fb1a4 (diff)
downloadradicle-native-ci-20fab34125be3fd481a79122d2186b2151ebfa70.tar.gz
refactor: add helper method to create a git repository
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rwxr-xr-xtest-suite9
1 files changed, 7 insertions, 2 deletions
diff --git a/test-suite b/test-suite
index 43eeabd..eb31a86 100755
--- a/test-suite
+++ b/test-suite
@@ -56,14 +56,19 @@ class Suite:
chosen = set(methods)
return chosen
- def _setup(self, repo_name, shell):
+ def _create_git_repo(self, repo_name):
git = Git(os.path.join(self.tmp, repo_name))
git.init()
git.write("README.md", "README")
+ git.commit("first commit")
+ return git
+
+ def _setup(self, repo_name, shell):
+ git = self._create_git_repo(repo_name)
native = NativeYaml(shell)
debug(f"native.yaml: {native.yaml()}")
git.write(".radicle/native.yaml", native.yaml())
- git.commit("first commit")
+ git.commit("add native.yaml")
commit = git.head()
self.rad.init(git)