Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.contentrules.tests.test_rule_assignment_mapping.TestRuleAssignmentMapping Class Reference
Inheritance diagram for plone.app.contentrules.tests.test_rule_assignment_mapping.TestRuleAssignmentMapping:
Inheritance graph
[legend]
Collaboration diagram for plone.app.contentrules.tests.test_rule_assignment_mapping.TestRuleAssignmentMapping:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testRuleRemoved
def testContainerMoved
def testParentOfContainerMoved
def testContainerRemoved

Public Attributes

 storage
 f11a
 f12a

Detailed Description

Definition at line 14 of file test_rule_assignment_mapping.py.


Member Function Documentation

Definition at line 16 of file test_rule_assignment_mapping.py.

00016 
00017     def afterSetUp(self):
00018         self.folder.invokeFactory('Folder', 'f1')
00019         self.folder.f1.invokeFactory('Folder', 'f11')
00020         self.folder.f1.invokeFactory('Folder', 'f12')
00021         
00022         self.storage = getUtility(IRuleStorage)
00023         self.storage['r1'] = Rule()
00024         self.storage['r2'] = Rule()
00025         
00026         self.f11a = IRuleAssignmentManager(self.folder.f1.f11)
00027         self.f11a['r1'] = RuleAssignment('r1')
00028         get_assignments(self.storage['r1']).insert('/'.join(self.folder.f1.f11.getPhysicalPath()))
00029         
00030         self.f12a = IRuleAssignmentManager(self.folder.f1.f12)
00031         self.f12a['r1'] = RuleAssignment('r1')
00032         get_assignments(self.storage['r1']).insert('/'.join(self.folder.f1.f12.getPhysicalPath()))
00033         
00034         self.f12a['r2'] = RuleAssignment('r2')
00035         get_assignments(self.storage['r2']).insert('/'.join(self.folder.f1.f12.getPhysicalPath()))
        

Definition at line 45 of file test_rule_assignment_mapping.py.

00045 
00046     def testContainerMoved(self):
00047         f12path = '/'.join(self.folder.f1.f12.getPhysicalPath())
00048         self.failUnless(f12path in get_assignments(self.storage['r1']))
00049         self.failUnless(f12path in get_assignments(self.storage['r2']))
00050         
00051         transaction.savepoint(1)
00052         self.folder.f1.manage_renameObject('f12', 'f12a')
00053         f12apath = '/'.join(self.folder.f1.f12a.getPhysicalPath())
00054         
00055         self.failIf(f12path in get_assignments(self.storage['r1']))
00056         self.failIf(f12path in get_assignments(self.storage['r2']))
00057         
00058         self.failUnless(f12apath in get_assignments(self.storage['r1']))
00059         self.failUnless(f12apath in get_assignments(self.storage['r1']))
        

Here is the call graph for this function:

Definition at line 75 of file test_rule_assignment_mapping.py.

00075 
00076     def testContainerRemoved(self):
00077         f12path = '/'.join(self.folder.f1.f12.getPhysicalPath())
00078         self.failUnless(f12path in get_assignments(self.storage['r1']))
00079         self.failUnless(f12path in get_assignments(self.storage['r2']))
00080         
00081         transaction.savepoint(1)
00082         self.folder._delObject('f1')
00083         
00084         self.failIf(f12path in get_assignments(self.storage['r1']))
00085         self.failIf(f12path in get_assignments(self.storage['r2']))
        

Here is the call graph for this function:

Definition at line 60 of file test_rule_assignment_mapping.py.

00060 
00061     def testParentOfContainerMoved(self):
00062         f12path = '/'.join(self.folder.f1.f12.getPhysicalPath())
00063         self.failUnless(f12path in get_assignments(self.storage['r1']))
00064         self.failUnless(f12path in get_assignments(self.storage['r2']))
00065         
00066         transaction.savepoint(1)
00067         self.folder.manage_renameObject('f1', 'f1a')
00068         f12apath = '/'.join(self.folder.f1a.f12.getPhysicalPath())
00069         
00070         self.failIf(f12path in get_assignments(self.storage['r1']))
00071         self.failIf(f12path in get_assignments(self.storage['r2']))
00072         
00073         self.failUnless(f12apath in get_assignments(self.storage['r1']))
00074         self.failUnless(f12apath in get_assignments(self.storage['r1']))
        

Here is the call graph for this function:

Definition at line 36 of file test_rule_assignment_mapping.py.

00036 
00037     def testRuleRemoved(self):
00038         self.failUnless('r1' in self.f11a)
00039         self.failUnless('r1' in self.f12a)
00040         
00041         del self.storage['r1']
00042         
00043         self.failIf('r1' in self.f11a)
00044         self.failIf('r1' in self.f12a)
        

Member Data Documentation

Definition at line 25 of file test_rule_assignment_mapping.py.

Definition at line 29 of file test_rule_assignment_mapping.py.

Definition at line 21 of file test_rule_assignment_mapping.py.


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