Back to index

plone3  3.1.7
Classes | Functions | Variables
GenericSetup.tests.test_tool Namespace Reference

Classes

class  SetupToolTests
class  _ToolsetSetup
class  Test_exportToolset
class  Test_importToolset
class  DummyTool
class  AnotherDummyTool
class  DummyToolRequiresId

Functions

def handleBeforeProfileImportEvent
def handleProfileImportedEvent
def _underscoreSiteTitle
def _uppercaseSiteTitle
def _purgeIfRequired
def _exportPropertiesINI
def test_suite

Variables

list _before_import_events = []
list _after_import_events = []
string _METADATA_XML
string _DEFAULT_STEP_REGISTRIES_EXPORT_XML
string _EXTRAS_STEP_REGISTRIES_EXPORT_XML
string _DEFAULT_STEP_REGISTRIES_IMPORT_XML
string _EXTRAS_STEP_REGISTRIES_IMPORT_XML
string _PROPERTIES_INI
string _EMPTY_TOOLSET_XML
string _NORMAL_TOOLSET_XML
string _FORBIDDEN_TOOLSET_XML
string _REQUIRED_TOOLSET_XML
string _WITH_ID_TOOLSET_XML

Function Documentation

Definition at line 1087 of file test_tool.py.

01087 
01088 def _exportPropertiesINI( context ):
01089 
01090     site = context.getSite()
01091     text = _PROPERTIES_INI % site.title
01092 
01093     context.writeDataFile( 'properties.ini', text, 'text/plain' )
01094 
01095     return 'Exported properties'
01096 

def GenericSetup.tests.test_tool._purgeIfRequired (   context) [private]

Definition at line 1081 of file test_tool.py.

01081 
01082 def _purgeIfRequired( context ):
01083 
01084     site = context.getSite()
01085     purged = site.purged = context.shouldPurge()
01086     return purged and 'Purged' or 'Unpurged'

Definition at line 1069 of file test_tool.py.

01069 
01070 def _underscoreSiteTitle( context ):
01071 
01072     site = context.getSite()
01073     site.title = site.title.replace( ' ', '_' )
01074     return 'Underscored title'

Definition at line 1075 of file test_tool.py.

01075 
01076 def _uppercaseSiteTitle( context ):
01077 
01078     site = context.getSite()
01079     site.title = site.title.upper()
01080     return 'Uppercased title'

Definition at line 50 of file test_tool.py.

00050 
00051 def handleBeforeProfileImportEvent(event):
00052     _before_import_events.append(event)

Definition at line 55 of file test_tool.py.

00055 
00056 def handleProfileImportedEvent(event):
00057     _after_import_events.append(event)

Definition at line 1427 of file test_tool.py.

01427 
01428 def test_suite():
01429     # reimport to make sure tests are run from Products
01430     from Products.GenericSetup.tests.test_tool import SetupToolTests
01431     from Products.GenericSetup.tests.test_tool import Test_exportToolset
01432     from Products.GenericSetup.tests.test_tool import Test_importToolset
01433 
01434     return unittest.TestSuite((
01435         unittest.makeSuite( SetupToolTests ),
01436         unittest.makeSuite( Test_exportToolset ),
01437         unittest.makeSuite( Test_importToolset ),
01438         ))

Here is the call graph for this function:


Variable Documentation

Definition at line 53 of file test_tool.py.

Definition at line 48 of file test_tool.py.

Initial value:
00001 """\
00002 <?xml version="1.0"?>
00003 <export-steps>
00004  <export-step id="step_registries"
00005               handler="Products.GenericSetup.tool.exportStepRegistries"
00006               title="Export import / export steps.">
00007   
00008  </export-step>
00009 </export-steps>
00010 """

Definition at line 996 of file test_tool.py.

Initial value:
00001 """\
00002 <?xml version="1.0"?>
00003 <import-steps>
00004  <import-step id="foo" handler="foo.bar" title="foo">
00005   
00006  </import-step>
00007 </import-steps>
00008 """

Definition at line 1025 of file test_tool.py.

Initial value:
00001 """\
00002 <?xml version="1.0"?>
00003 <tool-setup>
00004 </tool-setup>
00005 """

Definition at line 1379 of file test_tool.py.

Initial value:
00001 """\
00002 <?xml version="1.0"?>
00003 <export-steps>
00004  <export-step
00005     id="properties"
00006     handler="Products.GenericSetup.tests.test_tool._exportPropertiesINI"
00007     title="properties">
00008 
00009  </export-step>
00010  <export-step
00011     id="step_registries"
00012     handler="Products.GenericSetup.tool.exportStepRegistries"
00013     title="Export import / export steps.">
00014 
00015  </export-step>
00016 </export-steps>
00017 """

Definition at line 1007 of file test_tool.py.

Initial value:
00001 """\
00002 <?xml version="1.0"?>
00003 <import-steps>
00004  <import-step
00005     id="dependable"
00006     version="1"
00007     handler="Products.GenericSetup.tests.test_tool._underscoreSiteTitle"
00008     title="dependable">
00009   <dependency step="purging" />
00010 
00011  </import-step>
00012  <import-step
00013     id="dependent"
00014     version="1"
00015     handler="Products.GenericSetup.tests.test_tool._uppercaseSiteTitle"
00016     title="dependent">
00017   <dependency step="dependable" />
00018 
00019  </import-step>
00020  <import-step
00021     id="purging"
00022     version="1"
00023     handler="Products.GenericSetup.tests.test_tool._purgeIfRequired"
00024     title="purging">
00025 
00026  </import-step>
00027 </import-steps>
00028 """

Definition at line 1034 of file test_tool.py.

Initial value:
00001 """\
00002 <?xml version="1.0"?>
00003 <tool-setup>
00004  <forbidden tool_id="doomed" />
00005  <forbidden tool_id="damned" />
00006  <forbidden tool_id="blasted" />
00007 </tool-setup>
00008 """

Definition at line 1394 of file test_tool.py.

Initial value:
00001 """<?xml version="1.0"?>
00002 <metadata>
00003   <version>1.0</version>
00004   <dependencies>
00005     <dependency>profile-other:bar</dependency>
00006   </dependencies>
00007 </metadata>
00008 """

Definition at line 58 of file test_tool.py.

Initial value:
00001 """\
00002 <?xml version="1.0" ?>
00003 <tool-setup>
00004 <forbidden tool_id="doomed"/>
00005 <required class="path.to.one" tool_id="mandatory"/>
00006 <required class="path.to.another" tool_id="obligatory"/>
00007 </tool-setup>
00008 """

Definition at line 1385 of file test_tool.py.

Initial value:
00001 """\
00002 [Default]
00003 Title=%s
00004 """

Definition at line 1063 of file test_tool.py.

Initial value:
00001 """\
00002 <?xml version="1.0"?>
00003 <tool-setup>
00004  <required
00005     tool_id="mandatory"
00006     class="Products.GenericSetup.tests.test_tool.DummyTool" />
00007  <required
00008     tool_id="obligatory"
00009     class="Products.GenericSetup.tests.test_tool.DummyTool" />
00010 </tool-setup>
00011 """

Definition at line 1403 of file test_tool.py.

Initial value:
00001 """\
00002 <?xml version="1.0"?>
00003 <tool-setup>
00004   <required
00005     tool_id="mandatory"
00006     class="Products.GenericSetup.tests.test_tool.DummyTool" />
00007   <required
00008     tool_id="requires_id"
00009     class="Products.GenericSetup.tests.test_tool.DummyToolRequiresId" />
00010 </tool-setup>
00011 """

Definition at line 1415 of file test_tool.py.