mirror of
https://github.com/python/cpython.git
synced 2025-10-23 15:12:02 +00:00
parent
41518b4af0
commit
455f296188
2 changed files with 26 additions and 1 deletions
|
@ -395,6 +395,31 @@ class PydocDocTest(unittest.TestCase):
|
||||||
synopsis = pydoc.synopsis(TESTFN, {})
|
synopsis = pydoc.synopsis(TESTFN, {})
|
||||||
self.assertEqual(synopsis, 'line 1: h\xe9')
|
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):
|
class PydocImportTest(unittest.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ John Aycock
|
||||||
Donovan Baarda
|
Donovan Baarda
|
||||||
Arne Babenhauserheide
|
Arne Babenhauserheide
|
||||||
Attila Babo
|
Attila Babo
|
||||||
|
Matt Bachmann
|
||||||
Marcin Bachry
|
Marcin Bachry
|
||||||
Alfonso Baciero
|
Alfonso Baciero
|
||||||
Dwayne Bailey
|
Dwayne Bailey
|
||||||
|
@ -1364,4 +1365,3 @@ Cheng Zhang
|
||||||
Kai Zhu
|
Kai Zhu
|
||||||
Tarek Ziadé
|
Tarek Ziadé
|
||||||
Peter Åstrand
|
Peter Åstrand
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue