Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit 516aa7d

Browse files
OCoppingcoretl
authored andcommitted
Added final branch check to make sure skeleton-merge-branch was removed by the 'clean' command.
1 parent 89f0ce5 commit 516aa7d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/test_dls_python3_skeleton.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import sys
33
from configparser import ConfigParser
44
from pathlib import Path
5+
from typing import List
56

67
import pytest
78

@@ -17,6 +18,12 @@ def check_output(*args, cwd=None) -> str:
1718
raise ValueError(e.output)
1819

1920

21+
def check_branches(module: str) -> List[str]:
22+
return [
23+
x[2:] for x in str(__main__.git("branch", "--list", cwd=module)).split("\n")
24+
]
25+
26+
2027
def test_cli_version():
2128
output = check_output(sys.executable, "-m", "dls_python3_skeleton", "--version")
2229
assert output.strip() == __version__
@@ -112,10 +119,7 @@ def test_existing_module(tmp_path: Path):
112119
in str(excinfo.value)
113120
)
114121

115-
branches = [
116-
x[2:]
117-
for x in str(__main__.git("branch", "--list", cwd=str(module))).split("\n")
118-
]
122+
branches = check_branches(str(module))
119123
assert MERGE_BRANCH in branches
120124
output = check_output(
121125
sys.executable,
@@ -126,3 +130,5 @@ def test_existing_module(tmp_path: Path):
126130
cwd=str(module),
127131
)
128132
assert output.strip("\n") == f"{MERGE_BRANCH} deleted from existing repo"
133+
branches = check_branches(str(module))
134+
assert MERGE_BRANCH not in branches

0 commit comments

Comments
 (0)