0001 #! /usr/bin/env python 0002 """test script for a few new invalid token catches""" 0003 0004 import os 0005 import unittest 0006 from test import test_support 0007 0008 class EOFTestCase(unittest.TestCase): 0009 def test_EOFC(self): 0010 try: 0011 eval("""'this is a test\ 0012 """) 0013 except SyntaxError, msg: 0014 self.assertEqual(str(msg), 0015 "EOL while scanning single-quoted string (line 1)") 0016 else: 0017 raise test_support.TestFailed 0018 0019 def test_EOFS(self): 0020 try: 0021 eval("""'''this is a test""") 0022 except SyntaxError, msg: 0023 self.assertEqual(str(msg), 0024 "EOF while scanning triple-quoted string (line 1)") 0025 else: 0026 raise test_support.TestFailed 0027 0028 def test_main(): 0029 test_support.run_unittest(EOFTestCase) 0030 0031 if __name__ == "__main__": 0032 test_main() 0033
Generated by PyXR 0.9.4