def testLastCommand_empty(self): # user without a snippet last week should get a helpful message expect = "You didn't have any snippets last week!" # stuart never fills out self.assertIn(expect, slacklib.command_last('*****@*****.**')) # toby skipped last week self.assertIn(expect, slacklib.command_last('*****@*****.**'))
def testBadMarkdown_lastCommand(self): fozzie_last = slacklib.command_last('*****@*****.**') self.assertIn("not in a format I understand", fozzie_last)
def testLastCommand_noAccount(self): # user without an account should get a helpful error message response = slacklib.command_last('*****@*****.**') self.assertIn("You don't appear to have a snippets account", response)
def testLastCommand_formatting(self): # user with snippet should get back a formatted, numbered list response = slacklib.command_last('*****@*****.**') self.assertIn('> :pushpin: *[0]* lots of walks this week', response)