diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-03-19 06:28:07 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-03-19 06:28:07 (GMT) |
commit | dc41f552a2f1ba16e6a2fb2771ce127e3c693b40 (patch) | |
tree | c9d242f7d902394bcbb69e889e6c67087e77c286 | |
parent | b72406b8faca66a3a8c5ebcc9ec3baafbc5cc47c (diff) | |
parent | 455f296188dfaf25e4a3524a14ffe4db4f066fb9 (diff) | |
download | cpython-dc41f552a2f1ba16e6a2fb2771ce127e3c693b40.zip cpython-dc41f552a2f1ba16e6a2fb2771ce127e3c693b40.tar.gz cpython-dc41f552a2f1ba16e6a2fb2771ce127e3c693b40.tar.bz2 |
merge heads
-rw-r--r-- | Lib/test/test_pydoc.py | 25 | ||||
-rw-r--r-- | Misc/ACKS | 2 |
2 files changed, 26 insertions, 1 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index d98a526..aa8baf7 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -395,6 +395,31 @@ class PydocDocTest(unittest.TestCase): synopsis = pydoc.synopsis(TESTFN, {}) self.assertEqual(synopsis, 'line 1: h\xe9') + def test_splitdoc_with_description(self): + example_string = "I Am A Doc\n\n\nHere is my description" + self.assertEqual(pydoc.splitdoc(example_string), + ('I Am A Doc', '\nHere is my description')) + + def test_is_object_or_method(self): + doc = pydoc.Doc() + # Bound Method + self.assertTrue(pydoc._is_some_method(doc.fail)) + # Method Descriptor + self.assertTrue(pydoc._is_some_method(int.__add__)) + # String + self.assertFalse(pydoc._is_some_method("I am not a method")) + + def test_is_package_when_not_package(self): + with test.support.temp_cwd() as test_dir: + self.assertFalse(pydoc.ispackage(test_dir)) + + def test_is_package_when_is_package(self): + with test.support.temp_cwd() as test_dir: + init_path = os.path.join(test_dir, '__init__.py') + open(init_path, 'w').close() + self.assertTrue(pydoc.ispackage(test_dir)) + os.remove(init_path) + class PydocImportTest(unittest.TestCase): @@ -56,6 +56,7 @@ John Aycock Donovan Baarda Arne Babenhauserheide Attila Babo +Matt Bachmann Marcin Bachry Alfonso Baciero Dwayne Bailey @@ -1364,4 +1365,3 @@ Cheng Zhang Kai Zhu Tarek Ziadé Peter Åstrand - |