Skip to content

Commit

Permalink
chore: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisjared committed Nov 7, 2024
1 parent 360e45d commit 9ee2144
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
4 changes: 4 additions & 0 deletions packages/ref-core/src/ref_core/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class RefException(Exception):
"""Base class for exceptions related to REF operations"""

pass
5 changes: 2 additions & 3 deletions packages/ref/src/ref/cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def list(configuration_directory: Path | None = typer.Option(None, help="Configu
Print the current ref configuration
If a configuration directory is provided,
the configuration will attempted to be loaded from the specified directory.
If the configuration file is missing then a
the configuration will attempt to load from the specified directory.
"""
try:
if configuration_directory:
Expand All @@ -36,6 +35,6 @@ def list(configuration_directory: Path | None = typer.Option(None, help="Configu
@app.command()
def update() -> None:
"""
Print the current ref configuration
Update a configuration value
"""
print("config")
15 changes: 1 addition & 14 deletions packages/ref/tests/unit/cli/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,7 @@ def test_config_help():
result = runner.invoke(app, ["config", "--help"])
assert result.exit_code == 0

expected = """
Usage: ref config [OPTIONS] COMMAND [ARGS]...
View and update the REF configuration
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ list Print the current ref configuration │
│ update Print the current ref configuration │
╰──────────────────────────────────────────────────────────────────────────────╯
"""
assert expected in result.output
assert "View and update the REF configuration" in result.output


class TestConfigList:
Expand Down

0 comments on commit 9ee2144

Please sign in to comment.