Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bfabric-scripts 1.13.21 #144

Merged
merged 3 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bfabric_scripts/doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Versioning currently follows `X.Y.Z` where

## \[Unreleased\]

## \[1.13.21\] - 2025-02-11

### Fixed

- Add missing default value for columns in `bfabric-cli api read`

## \[1.13.20\] - 2025-02-10

### Added
Expand Down
2 changes: 1 addition & 1 deletion bfabric_scripts/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "bfabric_scripts"
description = "Python command line scripts for the B-Fabric API"
version = "1.13.20"
version = "1.13.21"

dependencies = [
"bfabric==1.13.20"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Params(BaseModel):
"""Output format."""
limit: int = 100
"""Maximum number of results."""
columns: list[str]
columns: list[str] = []
"""Selection of columns to return, comma separated list."""
cli_max_columns: int | None = 7
"""When showing the results as a table in the console (table-rich), the maximum number of columns to show."""
Expand Down
4 changes: 2 additions & 2 deletions tests/bfabric_cli/test_cli_api_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def sample_results():
class TestPerformQuery:
def test_perform_query_basic(self, mock_client, mock_console):
# Arrange
params = Params(endpoint="resource", query=[("status", "active")], columns=["id", "name"], limit=10)
params = Params(endpoint="resource", query=[("status", "active")])
mock_client.read.return_value = ResultContainer([{"id": 1, "name": "Test"}])

# Act
results = perform_query(params, mock_client, mock_console)

# Assert
mock_client.read.assert_called_once_with(endpoint="resource", obj={"status": "active"}, max_results=10)
mock_client.read.assert_called_once_with(endpoint="resource", obj={"status": "active"}, max_results=100)
assert len(results) == 1
assert results[0]["id"] == 1

Expand Down