Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def fields2names
def testBasic
def testSchemataFields
def testDelField
def testDelSchemata
def testAddSchemata
def testFieldChangeSchemata
def testMoveSchemata1
def testMoveSchemata2
def testMoveField
def testReplaceField

Public Attributes

 schema

Detailed Description

Definition at line 35 of file test_schemata_manipulation.py.


Member Function Documentation

Definition at line 37 of file test_schemata_manipulation.py.

00037 
00038     def afterSetUp(self):
00039         self.schema = ManagedSchema(
00040                (StringField('a', schemata='waldi'),
00041                 StringField('d', schemata='nasbaer'),
00042                 StringField('x', schemata='edgar'),
00043                 StringField('b', schemata='waldi'),
00044                 StringField('e', schemata='nasbaer'),
00045                 StringField('y', schemata='edgar'),
00046                 StringField('c', schemata='waldi'),
00047                 StringField('f', schemata='nasbaer'),
00048                 StringField('z', schemata='edgar')
00049             ))

Definition at line 50 of file test_schemata_manipulation.py.

00050 
00051     def fields2names(self, fields):
00052         return [f.getName() for f in fields]

Here is the caller graph for this function:

Definition at line 92 of file test_schemata_manipulation.py.

00092 
00093     def testAddSchemata(self):
00094         self.schema.addSchemata('otto')
00095         self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar', 'otto'])
00096         self.assertEqual(len(self.schema.getSchemataFields('otto')), 1)

Definition at line 53 of file test_schemata_manipulation.py.

00053 
00054     def testBasic(self):
00055         self.assertEqual(self.fields2names(self.schema.fields()),
00056                         ['a','d','x', 'b','e','y','c','f','z'])
00057         self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar'])
00058         self.schema.addField(StringField('p', schemata='waldi'))
00059         self.schema.addField(StringField('hello_world', schemata='helloworld'))
00060         self.schema.addField(StringField('hello_world1', schemata='helloworld1'))
00061         self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar', 'helloworld', 'helloworld1'])

Here is the call graph for this function:

Definition at line 69 of file test_schemata_manipulation.py.

00069 
00070     def testDelField(self):
00071         self.schema.delField('x')
00072         self.schema.delField('b')
00073         self.schema.delField('z')
00074         self.assertEqual(self.fields2names(self.schema.fields()),
00075                         ['a','d','e','y','c','f'])
00076         self.schema.addField(StringField('z'))
00077         self.schema.addField(StringField('b'))
00078         self.schema.addField(StringField('x'))
00079         self.assertEqual(self.fields2names(self.schema.fields()),
00080                         ['a','d','e','y','c','f','z','b','x'])
00081         self.schema.delField('b')
00082         self.schema.delField('z')
00083         self.schema.delField('x')
00084         self.assertEqual(self.fields2names(self.schema.fields()),
00085                         ['a','d','e','y','c','f'])

Here is the call graph for this function:

Definition at line 86 of file test_schemata_manipulation.py.

00086 
00087     def testDelSchemata(self):
00088         self.schema.delSchemata('nasbaer')
00089         self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'edgar'])
00090         self.schema.addField(StringField('hello_world', schemata='helloworld'))
00091         self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'edgar', 'helloworld'])

Definition at line 97 of file test_schemata_manipulation.py.

00097 
00098     def testFieldChangeSchemata(self):
00099         self.schema.changeSchemataForField('z','otto')
00100         self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar', 'otto'])
00101         self.assertEqual(self.fields2names(self.schema.getSchemataFields('otto')), ['z'])
00102         self.schema.changeSchemataForField('z','waldi')
00103         self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar'])

Here is the call graph for this function:

Definition at line 124 of file test_schemata_manipulation.py.

00124 
00125     def testMoveField(self):
00126         self.assertEqual(self.fields2names(self.schema.getSchemataFields('waldi')), ['a','b','c'])
00127         self.schema.moveField('a', -1)
00128         self.assertEqual(self.fields2names(self.schema.getSchemataFields('waldi')), ['a','b','c'])
00129         self.schema.moveField('a', 1)
00130         self.assertEqual(self.fields2names(self.schema.getSchemataFields('waldi')), ['b','a','c'])
00131         self.schema.moveField('a', 1)
00132         self.assertEqual(self.fields2names(self.schema.getSchemataFields('waldi')), ['b','c','a'])

Here is the call graph for this function:

Definition at line 104 of file test_schemata_manipulation.py.

00104 
00105     def testMoveSchemata1(self):
00106         self.schema.moveSchemata('waldi', -1)
00107         self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar'])
00108         self.schema.moveSchemata('waldi', 1)
00109         self.assertEqual(self.schema.getSchemataNames(), ['nasbaer', 'waldi', 'edgar'])
00110         self.schema.moveSchemata('waldi', 1)
00111         self.assertEqual(self.schema.getSchemataNames(), ['nasbaer', 'edgar', 'waldi'])
00112         self.schema.moveSchemata('waldi', 1)
00113         self.assertEqual(self.schema.getSchemataNames(), ['nasbaer', 'edgar', 'waldi'])

Definition at line 114 of file test_schemata_manipulation.py.

00114 
00115     def testMoveSchemata2(self):
00116         self.schema.moveSchemata('edgar', 1)
00117         self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'nasbaer', 'edgar'])
00118         self.schema.moveSchemata('edgar', -1)
00119         self.assertEqual(self.schema.getSchemataNames(), ['waldi', 'edgar', 'nasbaer'])
00120         self.schema.moveSchemata('edgar', -1)
00121         self.assertEqual(self.schema.getSchemataNames(), ['edgar', 'waldi', 'nasbaer'])
00122         self.schema.moveSchemata('edgar', -1)
00123         self.assertEqual(self.schema.getSchemataNames(), ['edgar', 'waldi', 'nasbaer'])

Definition at line 133 of file test_schemata_manipulation.py.

00133 
00134     def testReplaceField(self):
00135         f1 = StringField('f1')
00136         f2 = StringField('f2')
00137         f3 = StringField('f3')
00138         self.schema.replaceField('a', f1)
00139         self.schema.replaceField('e', f2)
00140         self.schema.replaceField('z', f3)
00141         self.assertEqual(self.fields2names(self.schema.fields()),
00142                         ['f1','d','x', 'b','f2','y','c','f','f3'])
00143 

Here is the call graph for this function:

Definition at line 62 of file test_schemata_manipulation.py.

00062 
00063     def testSchemataFields(self):
00064         self.assertEqual(self.fields2names(self.schema.getSchemataFields('waldi')),
00065                         ['a', 'b', 'c'])
00066         self.assertEqual(self.fields2names(self.schema.getSchemataFields('nasbaer')),
00067                         ['d', 'e', 'f'])
00068         self.assertEqual(self.fields2names(self.schema.getSchemataFields('edgar')),
                        ['x', 'y', 'z'])

Here is the call graph for this function:


Member Data Documentation

Definition at line 38 of file test_schemata_manipulation.py.


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