Back to index

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

List of all members.

Public Member Functions

def __init__
def tearDown
def test_class
def sourcerange
def assertSourceEqual

Public Attributes

 tempdir
 fodderModule
 source

Detailed Description

Definition at line 410 of file test_inspect.py.


Constructor & Destructor Documentation

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

Reimplemented from test.test_inspect.GetSourceBase.

Definition at line 411 of file test_inspect.py.

00411 
00412     def __init__(self, *args, **kwargs):
00413         self.tempdir = TESTFN + '_dir'
00414         os.mkdir(self.tempdir)
00415         with open(os.path.join(self.tempdir,
00416                                'inspect_fodder3%spy' % os.extsep), 'w') as f:
00417             f.write("class X:\n    pass # No EOL")
00418         with DirsOnSysPath(self.tempdir):
00419             import inspect_fodder3 as mod3
00420         self.fodderModule = mod3
00421         GetSourceBase.__init__(self, *args, **kwargs)

Here is the caller graph for this function:


Member Function Documentation

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

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 
) [inherited]

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:

Definition at line 422 of file test_inspect.py.

00422 
00423     def tearDown(self):
00424         shutil.rmtree(self.tempdir)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 425 of file test_inspect.py.

00425 
00426     def test_class(self):
00427         self.assertSourceEqual(self.fodderModule.X, 1, 2)
00428 
# Helper for testing classify_class_attrs.

Here is the call graph for this function:


Member Data Documentation

Reimplemented from test.test_inspect.GetSourceBase.

Definition at line 419 of file test_inspect.py.

Definition at line 205 of file test_inspect.py.

Definition at line 412 of file test_inspect.py.


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