def test_parse_args(self): body = ("+/u/{user} python 3 --time\n\n" " \n x = input()\n print(\"x\")\n \n\n\n" "Input: \n\n 5\n 6\n 7").format(user=self.user) args, source, stdin = cb.parse_comment(body) self.assertEqual(args, 'python 3 --time') self.assertEqual(source, ' x = input()\nprint(\"x\")\n') self.assertEqual(stdin, '5\n6\n7')
def test_parser(self): body = ("This sentence should not be included. +/u/{user} python 3\n\n" " print(\"Test\")\n\n" "This sentence should not be included.".format(user=self.user)) args, source, stdin = cb.parse_comment(body) self.assertEqual(args, 'python 3') self.assertEqual(source, 'print(\"Test\")') self.assertEqual(stdin, '')