2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 17:52:17 +00:00
Files
python/pyste/tests/inherit2UT.py
Bruno da Silva de Oliveira 73e2ab5125 - Added a new test exercising the new automatic inheritation
[SVN r18815]
2003-06-17 01:56:45 +00:00

26 lines
639 B
Python

import unittest
from _inherit2 import *
class InheritExampleTest(unittest.TestCase):
def testIt(self):
b = B()
d = D()
self.assert_(issubclass(D, B))
b.x, b.y = 10, 5
self.assertEqual(b.getx(), 10)
self.assertEqual(b.gety(), 5)
d.x, d.y, d.z, d.w = 20, 15, 10, 5
self.assertEqual(d.getx(), 20)
self.assertEqual(d.gety(), 15)
self.assertEqual(d.getz(), 10)
self.assertEqual(d.getw(), 5)
def wrong():
return b.getw()
self.assertRaises(AttributeError, wrong)
if __name__ == '__main__':
unittest.main()