Skip to content
Browse files

Added test capturing the behavior that subclasses produce more instan…

…ces of that subclass.
  • Loading branch information...
1 parent f72107b commit 92b74cd4101499672590dade3bd2b554485b4a25 @jaraco committed Jan 15, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 test_path.py
View
13 test_path.py
@@ -603,6 +603,19 @@ def testRmtreeP(self):
self.fail("Calling `rmtree_p` on non-existent directory "
"should not raise an exception.")
+class SubclassTestCase(unittest.TestCase):
+ class PathSubclass(path):
+ pass
+
+ def test_subclass_produces_same_class(self):
+ """
+ When operations are invoked on a subclass, they should produce another
+ instance of that subclass.
+ """
+ p = self.PathSubclass('/foo')
+ subdir = p / 'bar'
+ assert isinstance(subdir, self.PathSubclass)
+
class TempDirTestCase(unittest.TestCase):
def test_constructor(self):
"""

0 comments on commit 92b74cd

Please sign in to comment.
Something went wrong with that request. Please try again.