mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
test: update vc-branch test. default branch could be main as well
This commit is contained in:
parent
d4ff96ab25
commit
c4ee058e6e
2 changed files with 26 additions and 3 deletions
23
news/update-prompt-vc-branch-tests.rst
Normal file
23
news/update-prompt-vc-branch-tests.rst
Normal file
|
@ -0,0 +1,23 @@
|
|||
**Added:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Changed:**
|
||||
|
||||
* tests for vc-branch should accept both master and main
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
|
@ -189,7 +189,7 @@ def test_promptformatter_clears_cache(formatter):
|
|||
|
||||
|
||||
# Xonsh interaction with version control systems.
|
||||
VC_BRANCH = {"git": "master", "hg": "default"}
|
||||
VC_BRANCH = {"git": {"master", "main"}, "hg": {"default"}}
|
||||
|
||||
|
||||
@pytest.fixture(scope="module", params=VC_BRANCH.keys())
|
||||
|
@ -240,7 +240,7 @@ def test_vc_get_branch(test_repo, xonsh_builtins):
|
|||
fun = "get_{}_branch".format(test_repo["name"])
|
||||
obs = getattr(vc, fun)()
|
||||
if obs is not None:
|
||||
assert obs == VC_BRANCH[test_repo["name"]]
|
||||
assert obs in VC_BRANCH[test_repo["name"]]
|
||||
if test_repo["name"] == "git":
|
||||
with open("{}/.git/config".format(test_repo["dir"]), "a") as gc:
|
||||
gc.write(
|
||||
|
@ -254,7 +254,7 @@ def test_vc_get_branch(test_repo, xonsh_builtins):
|
|||
)
|
||||
obs = getattr(vc, fun)()
|
||||
if obs is not None:
|
||||
assert obs == VC_BRANCH[test_repo["name"]]
|
||||
assert obs in VC_BRANCH[test_repo["name"]]
|
||||
assert not obs.startswith(u"\u001b[")
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue