Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
Archetypes.tests.atsitetestcase.ATFunctionalSiteTestCase Class Reference
Inheritance diagram for Archetypes.tests.atsitetestcase.ATFunctionalSiteTestCase:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.tests.atsitetestcase.ATFunctionalSiteTestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def interact

Static Public Attributes

 layer = ZCMLLayer

Detailed Description

AT test case for functional tests with Plone site

Definition at line 14 of file atsitetestcase.py.


Member Function Documentation

Provides an interactive shell aka console inside your testcase.

It looks exact like in a doctestcase and you can copy and paste
code from the shell into your doctest. The locals in the testcase are 
available, becasue you are in the testcase.
    
In your testcase or doctest you can invoke the shell at any point by
calling::
    
    >>> interact( locals() )        
    
locals -- passed to InteractiveInterpreter.__init__()

Definition at line 18 of file atsitetestcase.py.

00018 
00019     def interact(self, locals=None):
00020         """Provides an interactive shell aka console inside your testcase.
00021         
00022         It looks exact like in a doctestcase and you can copy and paste
00023         code from the shell into your doctest. The locals in the testcase are 
00024         available, becasue you are in the testcase.
00025     
00026         In your testcase or doctest you can invoke the shell at any point by
00027         calling::
00028             
00029             >>> interact( locals() )        
00030             
00031         locals -- passed to InteractiveInterpreter.__init__()
00032         """
00033         savestdout = sys.stdout
00034         sys.stdout = sys.stderr
00035         sys.stderr.write('\n'+'='*70)
00036         console = code.InteractiveConsole(locals)
00037         console.interact("""
00038 DocTest Interactive Console - (c) BlueDynamics Alliance, Austria, 2006
00039 Note: You have the same locals available as in your test-case. 
00040 Ctrl-D ends session and continues testing.
00041 """)
00042         sys.stdout.write('\nend of DocTest Interactive Console session\n')
00043         sys.stdout.write('='*70+'\n')
00044         sys.stdout = savestdout
00045 


Member Data Documentation

Archetypes.tests.attestcase.ATTestCase.layer = ZCMLLayer [static, inherited]

Reimplemented in Archetypes.tests.attestcase.ATFunctionalTestCase.

Definition at line 32 of file attestcase.py.


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