示例#1
0
 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')
示例#2
0
 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')
示例#3
0
 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, '')
示例#4
0
 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, '')