OILS / opy / compiler2 / consts_test.py View on Github | oilshell.org

28 lines, 16 significant
1#!/usr/bin/env python2
2"""
3consts_test.py: Tests for consts.py
4"""
5
6import unittest
7
8import consts # module under test
9
10
11class ConstsTest(unittest.TestCase):
12
13 def testFoo(self):
14 self.assertEqual(consts.CO_OPTIMIZED, 0x0001)
15 self.assertEqual(consts.CO_NEWLOCALS, 0x0002)
16 self.assertEqual(consts.CO_VARARGS, 0x0004)
17 self.assertEqual(consts.CO_VARKEYWORDS, 0x0008)
18 self.assertEqual(consts.CO_NESTED, 0x0010)
19 self.assertEqual(consts.CO_GENERATOR, 0x0020)
20
21 self.assertEqual(consts.CO_FUTURE_DIVISION, 0x2000)
22 self.assertEqual(consts.CO_FUTURE_ABSIMPORT, 0x4000)
23 self.assertEqual(consts.CO_FUTURE_WITH_STATEMENT, 0x8000)
24 self.assertEqual(consts.CO_FUTURE_PRINT_FUNCTION, 0x10000)
25
26
27if __name__ == '__main__':
28 unittest.main()