Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_textwrap.IndentTestCases Class Reference
Inheritance diagram for test.test_textwrap.IndentTestCases:
Inheritance graph
[legend]
Collaboration diagram for test.test_textwrap.IndentTestCases:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def test_fill
def test_initial_indent
def test_subsequent_indent
def show
def check
def check_wrap
def check_split

Public Attributes

 text

Detailed Description

Definition at line 438 of file test_textwrap.py.


Member Function Documentation

def test.test_textwrap.BaseTestCase.check (   self,
  result,
  expect 
) [inherited]

Definition at line 31 of file test_textwrap.py.

00031 
00032     def check(self, result, expect):
00033         self.assertEqual(result, expect,
00034             'expected:\n%s\nbut got:\n%s' % (
00035                 self.show(expect), self.show(result)))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_textwrap.BaseTestCase.check_split (   self,
  text,
  expect 
) [inherited]

Definition at line 40 of file test_textwrap.py.

00040 
00041     def check_split(self, text, expect):
00042         result = self.wrapper._split(text)
00043         self.assertEqual(result, expect,
00044                          "\nexpected %r\n"
00045                          "but got  %r" % (expect, result))
00046 

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_textwrap.BaseTestCase.check_wrap (   self,
  text,
  width,
  expect,
  kwargs 
) [inherited]

Definition at line 36 of file test_textwrap.py.

00036 
00037     def check_wrap(self, text, width, expect, **kwargs):
00038         result = wrap(text, width, **kwargs)
00039         self.check(result, expect)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 441 of file test_textwrap.py.

00441 
00442     def setUp(self):
00443         self.text = '''\
00444 This paragraph will be filled, first without any indentation,
00445 and then with some (including a hanging indent).'''
00446 

Here is the caller graph for this function:

def test.test_textwrap.BaseTestCase.show (   self,
  textin 
) [inherited]

Definition at line 20 of file test_textwrap.py.

00020 
00021     def show(self, textin):
00022         if isinstance(textin, list):
00023             result = []
00024             for i in range(len(textin)):
00025                 result.append("  %d: %r" % (i, textin[i]))
00026             result = '\n'.join(result)
00027         elif isinstance(textin, str):
00028             result = "  %s\n" % repr(textin)
00029         return result
00030 

Here is the caller graph for this function:

Definition at line 447 of file test_textwrap.py.

00447 
00448     def test_fill(self):
00449         # Test the fill() method
00450 
00451         expect = '''\
00452 This paragraph will be filled, first
00453 without any indentation, and then with
00454 some (including a hanging indent).'''
00455 
00456         result = fill(self.text, 40)
00457         self.check(result, expect)
00458 

Here is the call graph for this function:

Definition at line 459 of file test_textwrap.py.

00459 
00460     def test_initial_indent(self):
00461         # Test initial_indent parameter
00462 
00463         expect = ["     This paragraph will be filled,",
00464                   "first without any indentation, and then",
00465                   "with some (including a hanging indent)."]
00466         result = wrap(self.text, 40, initial_indent="     ")
00467         self.check(result, expect)
00468 
00469         expect = "\n".join(expect)
00470         result = fill(self.text, 40, initial_indent="     ")
00471         self.check(result, expect)
00472 

Here is the call graph for this function:

Definition at line 473 of file test_textwrap.py.

00473 
00474     def test_subsequent_indent(self):
00475         # Test subsequent_indent parameter
00476 
00477         expect = '''\
00478   * This paragraph will be filled, first
00479     without any indentation, and then
00480     with some (including a hanging
00481     indent).'''
00482 
00483         result = fill(self.text, 40,
00484                       initial_indent="  * ", subsequent_indent="    ")
00485         self.check(result, expect)
00486 
00487 
00488 # Despite the similar names, DedentTestCase is *not* the inverse
# of IndentTestCase!

Here is the call graph for this function:


Member Data Documentation

Definition at line 442 of file test_textwrap.py.


The documentation for this class was generated from the following file: