Cobular / distest

A library used to do integration testing on discord bots
MIT License
29 stars 8 forks source link

Unable to test command that requires quoted arg #30

Open Fuzzwah opened 3 years ago

Fuzzwah commented 3 years ago

My discord bot has a command that returns an image and is triggered using something like:

!trigger option "firstname lastname" "second person"

The target bot works fine, and using the quotes successfully informs the bot which words are all part of a single name as it sees them as a single arg.

I've attempted to configure a test using:

await interface.assert_reply_has_image('!trigger option "firstname lastname" "second person"')

But the quote marks get stripped out.

I tried escaping the quotes with both 1 and 3 backslashes, but neither worked as the test bot threw the error:

raise SyntaxError("Invalid Number of Arguments")

With out the quotes the command fails because it thinks that each work (firstname, lastname, second, person) are each complete names.

Any tips on how I can test using quoted args?