update
This commit is contained in:
@@ -40,6 +40,38 @@ def test_help_flag():
|
||||
assert "setup" in result.stdout
|
||||
|
||||
|
||||
def test_short_help_flag():
|
||||
"""Test -h shows commands."""
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-m", "flow", "-h"],
|
||||
capture_output=True, text=True,
|
||||
)
|
||||
assert result.returncode == 0
|
||||
assert "dotfiles" in result.stdout
|
||||
assert "packages" in result.stdout
|
||||
assert "setup" in result.stdout
|
||||
|
||||
|
||||
def test_help_groups_aliases():
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-m", "flow", "--help"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
assert result.returncode == 0
|
||||
lines = [line for line in result.stdout.splitlines() if "│" in line]
|
||||
|
||||
dotfiles_line = next(line for line in lines if "dotfiles" in line and "dot" in line)
|
||||
assert "dotfiles, dot" in dotfiles_line
|
||||
assert next(line for line in lines if "packages" in line and "package" in line).startswith("│")
|
||||
packages_line = next(line for line in lines if "packages" in line and "pkg" in line)
|
||||
assert "packages, package, pkg" in packages_line
|
||||
setup_line = next(line for line in lines if "setup" in line and "bootstrap" in line)
|
||||
assert "setup, bootstrap, provision" in setup_line
|
||||
projects_line = next(line for line in lines if "projects" in line and "project" in line)
|
||||
assert "projects, project" in projects_line
|
||||
|
||||
|
||||
def test_no_color_flag():
|
||||
"""Test --no-color flag is accepted."""
|
||||
result = subprocess.run(
|
||||
@@ -64,6 +96,10 @@ def test_dotfiles_help():
|
||||
assert "sync" not in result.stdout
|
||||
assert "modules" not in result.stdout
|
||||
|
||||
repos_lines = [line for line in result.stdout.splitlines() if "repos" in line]
|
||||
assert len(repos_lines) == 1
|
||||
assert "repos, repo" in repos_lines[0]
|
||||
|
||||
|
||||
def test_packages_help():
|
||||
result = subprocess.run(
|
||||
|
||||
Reference in New Issue
Block a user