Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/python/pyste/tests/inheritUT.py @ 47

Last change on this file since 47 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 933 bytes
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 _inherit import *
7
8class InheritExampleTest(unittest.TestCase):
9
10    def testIt(self):
11        a = A_int()       
12        b = B()
13        self.assert_(isinstance(b, A_int))
14        self.assert_(issubclass(B, A_int))
15        a.set(10)
16        self.assertEqual(a.get(), 10)       
17        b.set(1)
18        self.assertEqual(b.go(), 1)
19        self.assertEqual(b.get(), 1)
20
21        d = D()
22        self.assert_(issubclass(D, B))
23        self.assertEqual(d.x, 0)
24        self.assertEqual(d.y, 0)
25        self.assertEqual(d.s, 1)
26        self.assertEqual(D.s, 1)
27        self.assertEqual(d.f1(), 1)
28        self.assertEqual(d.f2(), 2)
29
30
31
32if __name__ == '__main__':
33    unittest.main() 
Note: See TracBrowser for help on using the repository browser.