Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def test_empty
def test_create
def test_set
def test_get
def test_del

Public Attributes

 dummy
 ann

Detailed Description

Definition at line 54 of file test_annotation.py.


Member Function Documentation

Definition at line 56 of file test_annotation.py.

00056 
00057     def afterSetUp(self):
00058         gen_dummy()
00059         dummy = Dummy(oid='dummy')
00060         self.folder._setObject('dummy', dummy)
00061         self.folder.dummy.initializeArchetype()
00062         self.dummy = self.folder.dummy
00063         self.ann = getAnnotation(self.dummy)
        

Here is the call graph for this function:

Definition at line 69 of file test_annotation.py.

00069 
00070     def test_create(self):
00071         ann = self.ann
00072         ann['test'] = 'test'
00073         self.failUnlessEqual(bool(ann), True)
00074         self.failIfEqual(getattr(self.dummy, '__annotations__', None), None)
    

Definition at line 93 of file test_annotation.py.

00093 
00094     def test_del(self):
00095         ann = self.ann
00096         ann['test'] = 'test1'
00097         del ann['test']
00098         self.failIf(ann.has_key('test'))
00099         ann.setSubkey('test', 'test3', subkey='testsub')
00100         ann.delSubkey('test', subkey='testsub')
00101         self.failIf(ann.has_key('test-testsub'))
00102         self.failIf(ann.hasSubkey('test', subkey='testsub'))
00103 

Definition at line 64 of file test_annotation.py.

00064 
00065     def test_empty(self):
00066         ann = self.ann
00067         self.failUnlessEqual(bool(ann), False)
00068         self.failUnlessEqual(getattr(self.dummy, '__annotations__', None), None)
        

Definition at line 85 of file test_annotation.py.

00085 
00086     def test_get(self):
00087         ann = self.ann
00088         ann['test'] = 'test1'
00089         self.failUnlessEqual(ann['test'], 'test1')
00090         self.failUnlessEqual(ann.get('test'), 'test1')
00091         self.failUnless(ann.has_key('test'))
00092         self.failUnlessEqual(ann.get('none', default='default'), 'default')
        

Definition at line 75 of file test_annotation.py.

00075 
00076     def test_set(self):
00077         ann = self.ann
00078         ann['test'] = 'test1'
00079         self.failUnlessEqual(ann['test'], 'test1')
00080         ann.set('test', 'test2')
00081         self.failUnlessEqual(ann['test'], 'test2')
00082         ann.setSubkey('test', 'test3', subkey='testsub')
00083         self.failUnlessEqual(ann['test-testsub'], 'test3')
00084         self.failUnlessEqual(ann.getSubkey('test', subkey='testsub'), 'test3')
        

Member Data Documentation

Definition at line 62 of file test_annotation.py.

Definition at line 61 of file test_annotation.py.


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