From 4b9e3d655f2b9b9e27aad8dccdf3325f26c34cfe Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 10 Jan 2018 12:18:37 -0500 Subject: [PATCH] virtuals_fs: Add test for sample_conversation. --- .../zulip_bots/bots/virtual_fs/test_virtual_fs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zulip_bots/zulip_bots/bots/virtual_fs/test_virtual_fs.py b/zulip_bots/zulip_bots/bots/virtual_fs/test_virtual_fs.py index 72c2aab..2f619ba 100755 --- a/zulip_bots/zulip_bots/bots/virtual_fs/test_virtual_fs.py +++ b/zulip_bots/zulip_bots/bots/virtual_fs/test_virtual_fs.py @@ -18,6 +18,16 @@ class TestVirtualFsBot(BotTestCase): '```\n' 'Use commands like `@mention-bot help write` for more details on specific\ncommands.\n') + def test_sample_conversation_help(self) -> None: + # There's nothing terribly tricky about the "sample conversation," + # so we just do a quick sanity check. + reply = self.get_reply_dict('sample_conversation') + content = reply['content'] + frag = 'foo@example.com:\ncd /\nCurrent path: /\n\n' + self.assertTrue(content.startswith(frag)) + frag = 'read home/stuff/file1\nERROR: file does not exist\n\n' + self.assertIn(frag, content) + def test_commands_1(self) -> None: expected = [ ("cd /home", "foo@example.com:\nERROR: invalid path"),