Skip to content

Commit a1ba5d4

Browse files
Fix tests + add additional test
1 parent ec97173 commit a1ba5d4

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

src/blueapi/client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def __repr__(self):
229229

230230
single_line = f"{self.name}({', '.join(args)})"
231231
max_length = 100
232-
max_args_inline = 4
232+
max_args_inline = 3
233233
if len(single_line) <= max_length and len(args) <= max_args_inline:
234234
return single_line
235235

tests/unit_tests/client/test_client.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,29 @@ def test_plan_fallback_help_text(client):
716716
),
717717
client,
718718
)
719-
assert plan.help_text == "Plan foo(one, two=None)"
719+
assert plan.help_text == "Plan foo(one: Any, two: Any | None = None)"
720+
721+
722+
def test_plan_multi_parameter_fallback_help_text(client):
723+
plan = Plan(
724+
"foo",
725+
PlanModel(
726+
name="foo",
727+
schema={
728+
"properties": {"one": {}, "two": {}, "three": {}, "four": {}},
729+
"required": ["one"],
730+
},
731+
),
732+
client,
733+
)
734+
assert (
735+
plan.help_text == "Plan foo(\n"
736+
" one: Any,\n"
737+
" two: Any | None = None,\n"
738+
" three: Any | None = None,\n"
739+
" four: Any | None = None\n"
740+
")"
741+
)
720742

721743

722744
def test_plan_properties(client):

0 commit comments

Comments
 (0)