Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
test.test_inspect.GetSourceBase Class Reference
Inheritance diagram for test.test_inspect.GetSourceBase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def sourcerange
def assertSourceEqual

Public Attributes

 source

Static Public Attributes

 fodderModule = None

Detailed Description

Definition at line 197 of file test_inspect.py.


Constructor & Destructor Documentation

def test.test_inspect.GetSourceBase.__init__ (   self,
  args,
  kwargs 
)

Reimplemented in test.test_inspect.TestNoEOL.

Definition at line 201 of file test_inspect.py.

00201 
00202     def __init__(self, *args, **kwargs):
00203         unittest.TestCase.__init__(self, *args, **kwargs)
00204 
00205         with open(inspect.getsourcefile(self.fodderModule)) as fp:
00206             self.source = fp.read()

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def test.test_inspect.GetSourceBase.assertSourceEqual (   self,
  obj,
  top,
  bottom 
)

Definition at line 211 of file test_inspect.py.

00211 
00212     def assertSourceEqual(self, obj, top, bottom):
00213         self.assertEqual(inspect.getsource(obj),
00214                          self.sourcerange(top, bottom))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_inspect.GetSourceBase.sourcerange (   self,
  top,
  bottom 
)

Definition at line 207 of file test_inspect.py.

00207 
00208     def sourcerange(self, top, bottom):
00209         lines = self.source.split("\n")
00210         return "\n".join(lines[top-1:bottom]) + "\n"

Here is the caller graph for this function:


Member Data Documentation

Definition at line 205 of file test_inspect.py.


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