Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/python/pyste/tests/header_testUT.py @ 13

Last change on this file since 13 was 12, checked in by landauf, 17 years ago

added boost

File size: 1.0 KB
Line 
1# Copyright Bruno da Silva de Oliveira 2003. Use, modification and
2# distribution is subject to the Boost Software License, Version 1.0.
3# (See accompanying file LICENSE_1_0.txt or copy at
4# http:#www.boost.org/LICENSE_1_0.txt)
5import unittest
6from _header_test import *
7
8class HeaderTest(unittest.TestCase):
9   
10    def testIt(self):
11        self.assertEqual(choice.red, 0)
12        self.assertEqual(choice.blue, 1)
13        self.assertEqual(choice_str(choice.blue), 'blue')
14        self.assertEqual(choice_str(choice.red), 'red')
15        c = C()
16        c.c = choice.blue
17        self.assertEqual(c.get(), 'blue')
18        c.c = choice.red
19        self.assertEqual(c.get(), 'red')
20        # the following classes/functions should not have being exported
21        self.assertRaises(NameError, lambda: A())
22        self.assertRaises(NameError, lambda: foo())
23        self.assertRaises(NameError, lambda: bar.value)
24        self.assertRaises(NameError, lambda: ForwardDeclared())
25       
26if __name__ == '__main__':
27    unittest.main()   
Note: See TracBrowser for help on using the repository browser.