Skip to content

Commit

Permalink
Merge pull request #144 from fgcz/main
Browse files Browse the repository at this point in the history
bfabric-scripts 1.13.21
  • Loading branch information
leoschwarz authored Feb 11, 2025
2 parents 3440b08 + 84906bf commit 9c4a179
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
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

0 comments on commit 9c4a179

Please sign in to comment.