Skip to content

Commit

Permalink
Merge branch 'feat/as/human-friendly-debug-representation-for-buttons…
Browse files Browse the repository at this point in the history
…' of https://github.com/ExpressApp/pybotx into feat/as/human-friendly-debug-representation-for-buttons
  • Loading branch information
siderai committed Jun 7, 2023
2 parents cfbce8c + a6c5e35 commit 761fa2a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pybotx/models/message/markup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __repr__(self) -> str:
buttons = []
for idx, row in enumerate(self._buttons, start=1):
row_buttons_strings = [
f"{button.command} ({button.label})" for button in row
f"{button.label} ({button.command})" for button in row
]
row_string = " | ".join(row_buttons_strings)
buttons.append(f"row {idx}: {row_string}")
Expand Down
18 changes: 18 additions & 0 deletions tests/models/test_markup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from pybotx import BubbleMarkup


def test__mentions_list_properties__filled() -> None:
# - Arrange -
bubbles = BubbleMarkup()
bubbles.add_button("command1", "label1")
bubbles.add_button(
"command2",
"label2",
)
bubbles.add_button("command3", "label3", new_row=False)

# - Assert -
assert (
bubbles.__repr__() # noqa: WPS609
== "row 1: label1 (command1), row 2: label2 (command2) | label3 (command3)"
)

0 comments on commit 761fa2a

Please sign in to comment.