Skip to content

Commit

Permalink
Expanded docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 14, 2012
1 parent 4ca082c commit aed55bf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test_path.py
Expand Up @@ -175,6 +175,11 @@ def testExplicitModuleClasses(self):
self.assertEqual(nt_path.__name__, 'path_ntpath')

class ReturnSelfTestCase(unittest.TestCase):
"""
Some methods don't necessarily return any value (i.e. makedirs,
makedirs_p, rename, mkdir, touch, chroot). These methods should return
self anyhow to allow methods to be chained.
"""
def setUp(self):
# Create a temporary directory.
f = tempfile.mktemp()
Expand All @@ -187,6 +192,9 @@ def tearDown(self):
shutil.rmtree(self.tempdir)

def testMakedirs_pReturnsSelf(self):
"""
path('foo').makedirs_p() == path('foo')
"""
p = path(self.tempdir) / "newpath"
ret = p.makedirs_p()
self.assertEquals(p, ret)
Expand Down

0 comments on commit aed55bf

Please sign in to comment.