]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_eof.py
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / test / test_eof.py
CommitLineData
4710c53d 1#! /usr/bin/env python\r
2"""test script for a few new invalid token catches"""\r
3\r
4import unittest\r
5from test import test_support\r
6\r
7class EOFTestCase(unittest.TestCase):\r
8 def test_EOFC(self):\r
9 expect = "EOL while scanning string literal (<string>, line 1)"\r
10 try:\r
11 eval("""'this is a test\\r
12 """)\r
13 except SyntaxError, msg:\r
14 self.assertEqual(str(msg), expect)\r
15 else:\r
16 raise test_support.TestFailed\r
17\r
18 def test_EOFS(self):\r
19 expect = ("EOF while scanning triple-quoted string literal "\r
20 "(<string>, line 1)")\r
21 try:\r
22 eval("""'''this is a test""")\r
23 except SyntaxError, msg:\r
24 self.assertEqual(str(msg), expect)\r
25 else:\r
26 raise test_support.TestFailed\r
27\r
28def test_main():\r
29 test_support.run_unittest(EOFTestCase)\r
30\r
31if __name__ == "__main__":\r
32 test_main()\r