Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testMutatorSetFilename
def testBaseObjectPrimaryFieldSetFilename
def testBaseObjectSetFilename
def testFieldSetFilename

Private Attributes

 _dummy

Detailed Description

Definition at line 109 of file test_filename.py.


Member Function Documentation

Definition at line 111 of file test_filename.py.

00111 
00112     def afterSetUp(self):
00113         gen_dummy()
00114         self._dummy = dummy = Dummy(oid='dummy')
00115         self._dummy.initializeArchetype()
00116         file1 = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.tgz'), 'r')
00117         file2 = open(os.path.join(PACKAGE_HOME, 'input', 'word.doc'), 'r')
00118         # afilefield is the primary field
00119         dummy.setAfilefield(file1)
00120         dummy.setAnotherfilefield(file2)
00121         file1.close()
00122         file2.close()

Here is the call graph for this function:

Definition at line 132 of file test_filename.py.

00132 
00133     def testBaseObjectPrimaryFieldSetFilename(self):
00134         obj = self._dummy
00135         filename1 = 'eitadiacho.mid'
00136         filename2 = 'ehagoraoununca.pdf'
00137         obj.setFilename(filename1)
00138         obj.setFilename(filename2, 'anotherfilefield')
00139         self.assertEqual(obj.getFilename(), filename1)
00140         self.assertEqual(obj.getFilename('afilefield'), filename1)
00141         self.assertEqual(obj.getFilename('anotherfilefield'), filename2)

Definition at line 142 of file test_filename.py.

00142 
00143     def testBaseObjectSetFilename(self):
00144         obj = self._dummy
00145         filename1 = 'masbahtche.avi'
00146         filename2 = 'guasco.mpg'
00147         obj.setFilename(filename1, 'afilefield')
00148         obj.setFilename(filename2, 'anotherfilefield')
00149         self.assertEqual(obj.getFilename(), filename1)
00150         self.assertEqual(obj.getFilename('afilefield'), filename1)
00151         self.assertEqual(obj.getFilename('anotherfilefield'), filename2)

Definition at line 152 of file test_filename.py.

00152 
00153     def testFieldSetFilename(self):
00154         obj = self._dummy
00155         field1 = obj.getField('afilefield')
00156         field2 = obj.getField('anotherfilefield')
00157         filename1 = 'muamba.gif'
00158         filename2 = 'noruega.jpg'
00159         field1.setFilename(obj, filename1)
00160         field2.setFilename(obj, filename2)
00161         self.assertEqual(field1.getFilename(obj), filename1)
00162         self.assertEqual(field2.getFilename(obj), filename2)
00163 

Definition at line 123 of file test_filename.py.

00123 
00124     def testMutatorSetFilename(self):
00125         obj = self._dummy
00126         field1 = obj.getField('afilefield')
00127         field2 = obj.getField('anotherfilefield')
00128         filename1 = 'rest1.tgz'
00129         filename2 = 'word.doc'
00130         self.assertEqual(field1.getFilename(obj), filename1)
00131         self.assertEqual(field2.getFilename(obj), filename2)


Member Data Documentation

Definition at line 113 of file test_filename.py.


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