Skip to content

Commit

Permalink
test: basic sanity checks of plugin.capability.__str__() method
Browse files Browse the repository at this point in the history
  • Loading branch information
dgw committed Dec 13, 2023
1 parent 31d0659 commit 972b94e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ def test_capability(cap_ack_wrapped):
assert result == (True, None)


def test_capability_as_string():
handler = plugin.capability('batch')
assert str(handler).startswith('<capability')
assert str(handler).endswith("'batch'>")

def _batch_callback(cap_req, bot, acknowledged):
...

handler = plugin.capability('batch', handler=_batch_callback)

assert '(_batch_callback())' in str(handler)


def test_capability_handler_define_once():
@plugin.capability('away-notify')
def handler(name, bot, acknowledged):
Expand Down

0 comments on commit 972b94e

Please sign in to comment.