Skip to content

Commit 709e06b

Browse files
committed
1 parent 4e1692e commit 709e06b

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

dms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def reply(text, type=None):
8585

8686
# dispatch!
8787
kwargs = {}
88-
if cmd_arg:
88+
if arg and cmd_arg:
8989
kwargs['arg'] = cmd_arg
9090
if arg == 'handle':
9191
kwargs['to_user'] = to_user

tests/test_dms.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -463,18 +463,21 @@ def test_receive_help_strip_mention_of_bot(self):
463463
self.assert_replied(OtherFake, alice, '?', "<p>Hi! I'm a friendly bot")
464464

465465
def test_receive_did_atproto(self):
466-
self.make_user(id='bsky.brid.gy', cls=Web)
467-
alice = self.make_user(id='efake:alice', cls=ExplicitFake,
468-
enabled_protocols=['atproto'], obj_as1={'x': 'y'},
469-
copies=[Target(protocol='atproto', uri='did:abc:123')])
470-
obj = Object(our_as1={
471-
**DM_BASE,
472-
'to': ['bsky.brid.gy'],
473-
'content': 'did',
474-
})
475-
self.assertEqual(('OK', 200), receive(from_user=alice, obj=obj))
476-
self.assert_replied(ATProto, alice, '?',
477-
'Your DID is <code>did:abc:123</code>')
466+
for content in 'did', 'did foo':
467+
ExplicitFake.sent = []
468+
with self.subTest(content=content):
469+
self.make_user(id='bsky.brid.gy', cls=Web)
470+
alice = self.make_user(id='efake:alice', cls=ExplicitFake,
471+
enabled_protocols=['atproto'], obj_as1={'x': 'y'},
472+
copies=[Target(protocol='atproto', uri='did:abc:123')])
473+
obj = Object(our_as1={
474+
**DM_BASE,
475+
'to': ['bsky.brid.gy'],
476+
'content': 'did',
477+
})
478+
self.assertEqual(('OK', 200), receive(from_user=alice, obj=obj))
479+
self.assert_replied(ATProto, alice, '?',
480+
'Your DID is <code>did:abc:123</code>')
478481

479482
def test_receive_block(self):
480483
alice, bob = self.make_alice_bob()

0 commit comments

Comments
 (0)