mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Improve defaults for testing suite (#1104)
This commit is contained in:
parent
4d8060e8cb
commit
5020890c34
|
|
@ -17,3 +17,6 @@ trim_trailing_whitespace = false
|
|||
|
||||
[*.html]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.py]
|
||||
indent_size = 4
|
||||
|
|
|
|||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -42,7 +42,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python 3.10
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
|
|
|
|||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.venv/
|
||||
__pycache__/
|
||||
|
|
@ -18,7 +18,7 @@ class TempRepository:
|
|||
repo_work_dir = os.path.join(self._system_tmpdir, repo_work_dir)
|
||||
self._cwd = repo_work_dir
|
||||
self._tempdirname = self._cwd[len(self._system_tmpdir) + 1:]
|
||||
self._git_repo = git.Repo.init(repo_work_dir)
|
||||
self._git_repo = git.Repo.init(repo_work_dir, b="default")
|
||||
self._files = []
|
||||
|
||||
def switch_cwd_under_repo(self):
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ class TestGitArchiveFile:
|
|||
|
||||
def test_archive_file_on_any_not_tags_branch_with_default_branch(self, temp_repo):
|
||||
git = temp_repo.get_repo_git()
|
||||
git.checkout("master")
|
||||
git.config("git-extras.default-branch", "master")
|
||||
git.checkout("default")
|
||||
git.config("git-extras.default-branch", "default")
|
||||
temp_repo.invoke_installed_extras_command("archive-file")
|
||||
filename = "{0}.{1}.zip".format(
|
||||
temp_repo.get_repo_dirname(),
|
||||
|
|
@ -53,13 +53,13 @@ class TestGitArchiveFile:
|
|||
filename = "{0}.{1}.{2}.zip".format(
|
||||
"backslash-dir",
|
||||
git.describe("--always", "--long"),
|
||||
"master")
|
||||
"default")
|
||||
assert filename in os.listdir()
|
||||
|
||||
def test_archive_file_on_tag_name_has_slash(self, temp_repo):
|
||||
temp_repo.switch_cwd_under_repo()
|
||||
git = temp_repo.get_repo_git()
|
||||
git.checkout("master")
|
||||
git.checkout("default")
|
||||
git.tag("--delete", "0.1.0")
|
||||
git.tag("0.1.0/slash", "-m", "bump: 0.1.0")
|
||||
temp_repo.invoke_installed_extras_command("archive-file")
|
||||
Loading…
Reference in a new issue