Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/python/pyste/tests/operatorsUT.py @ 29

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

updated boost from 1_33_1 to 1_34_1

File size: 923 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 _operators import *
7
8class OperatorTest(unittest.TestCase):
9
10    def testIt(self):             
11        c = C()
12        c.value = 3.0
13        d = C()
14        d.value = 2.0
15        self.assertEqual(c.x, 10)
16        self.assertEqual(C.x, 10)
17        self.assertEqual(C.x, 10)
18        self.assertEqual((c * d).value, 6.0)
19        self.assertEqual((c + d).value, 5.0)
20        self.assertEqual(int(c), 3)
21        self.assertEqual(int(d), 2)
22        self.assertEqual(c(), 10)
23        self.assertEqual(d(), 10)
24        self.assertEqual(c(3.0), 13.0)
25        self.assertEqual(d(6.0), 16.0)
26        self.assertEqual(str(c), "C")
27
28
29if __name__ == '__main__':
30    unittest.main() 
Note: See TracBrowser for help on using the repository browser.