diff options
Diffstat (limited to 'tests/test_base.py')
-rwxr-xr-x | tests/test_base.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_base.py b/tests/test_base.py index 73d1b08..4136045 100755 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -405,6 +405,15 @@ class VersionTestCase(unittest.TestCase): self.assertEqual(v.truncate("minor"), base.Version("3.2.0")) self.assertEqual(v.truncate("major"), base.Version("3.0.0")) + def test_subclass(self): + """Custom subclasses of Version returns instances of themselves.""" + class MyVersion(base.Version): + pass + + v = MyVersion("3.2.1-pre") + subv = v.truncate() + self.assertEqual(type(subv), MyVersion) + class SpecItemTestCase(unittest.TestCase): if sys.version_info[0] <= 2: |