2017-12-14 05:24:11 -05:00
|
|
|
from zulip_bots.test_lib import BotTestCase
|
2017-05-27 13:39:43 -04:00
|
|
|
|
2017-12-14 05:24:11 -05:00
|
|
|
class TestConverterBot(BotTestCase):
|
2017-05-27 13:39:43 -04:00
|
|
|
bot_name = "converter"
|
|
|
|
|
2017-12-07 18:53:29 -05:00
|
|
|
def test_bot(self) -> None:
|
2017-12-07 22:39:18 -05:00
|
|
|
dialog = [
|
2017-10-24 05:14:09 -04:00
|
|
|
("", 'Too few arguments given. Enter `@convert help` '
|
2017-05-29 17:14:11 -04:00
|
|
|
'for help on using the converter.\n'),
|
2017-10-24 05:14:09 -04:00
|
|
|
("foo bar", 'Too few arguments given. Enter `@convert help` '
|
2017-05-29 17:14:11 -04:00
|
|
|
'for help on using the converter.\n'),
|
2017-12-07 18:53:29 -05:00
|
|
|
("2 m cm", "2 m = 200.0 cm\n"),
|
2017-10-24 05:14:09 -04:00
|
|
|
("12.0 celsius fahrenheit", "12.0 celsius = 53.600054 fahrenheit\n"),
|
|
|
|
("0.002 kilometer millimile", "0.002 kilometer = 1.2427424 millimile\n"),
|
2017-12-07 18:53:29 -05:00
|
|
|
("3 megabyte kilobit", "3 megabyte = 24576.0 kilobit\n"),
|
2017-10-24 05:14:09 -04:00
|
|
|
]
|
2017-12-07 22:39:18 -05:00
|
|
|
self.verify_dialog(dialog)
|