Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def test_textfieldwithfilename
def test_textfieldwithfilename2
def test_textfieldwithoutfilename
def test_textfielduploadwithoutfilename
def test_filefieldwithfilename
def test_filefieldwithfilename2
def test_filefieldwithoutfilename
def test_filefielduploadwithoutfilename

Private Attributes

 _dummy

Detailed Description

Definition at line 41 of file test_filename.py.


Member Function Documentation

Definition at line 43 of file test_filename.py.

00043 
00044     def afterSetUp(self):
00045         gen_dummy()
00046         self._dummy = dummy = Dummy(oid='dummy')
00047         self._dummy.initializeArchetype()

Here is the call graph for this function:

Definition at line 100 of file test_filename.py.

00100 
00101     def test_filefielduploadwithoutfilename(self):
00102         obj = self._dummy
00103         file = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.tgz'), 'r')
00104         field = obj.getField('afilefield')
00105         obj.setAfilefield(file)
00106         file.close()
00107         self.assertEqual(field.getFilename(obj), 'rest1.tgz')
00108 

Definition at line 79 of file test_filename.py.

00079 
00080     def test_filefieldwithfilename(self):
00081         obj = self._dummy
00082         field = obj.getField('afilefield')
00083         obj.setAfilefield('Blo', filename='beleza.jpg')
00084         self.assertEqual(str(obj.getAfilefield()), 'Blo')
00085         self.assertEqual(field.getFilename(obj), 'beleza.jpg')

Definition at line 86 of file test_filename.py.

00086 
00087     def test_filefieldwithfilename2(self):
00088         obj = self._dummy
00089         field = obj.getField('afilefield')
00090         obj.setAfilefield('Blu', filename='juca.avi')
00091         self.assertEqual(str(obj.getAfilefield()), 'Blu')
00092         self.assertEqual(field.getFilename(obj), 'juca.avi')

Definition at line 93 of file test_filename.py.

00093 
00094     def test_filefieldwithoutfilename(self):
00095         obj = self._dummy
00096         field = obj.getField('afilefield')
00097         obj.setAfilefield('Blao')
00098         self.assertEqual(str(obj.getAfilefield()), 'Blao')
00099         self.assertEqual(field.getFilename(obj), '')

Definition at line 71 of file test_filename.py.

00071 
00072     def test_textfielduploadwithoutfilename(self):
00073         obj = self._dummy
00074         file = open(os.path.join(PACKAGE_HOME, 'input', 'rest1.tgz'), 'r')
00075         field = obj.getField('atextfield')
00076         obj.setAtextfield(file)
00077         file.close()
00078         self.assertEqual(field.getFilename(obj), 'rest1.tgz')

Definition at line 48 of file test_filename.py.

00048 
00049     def test_textfieldwithfilename(self):
00050         obj = self._dummy
00051         field = obj.getField('atextfield')
00052         self.assertEqual(field.getFilename(obj), '')
00053         self.assertEqual(field.getRaw(obj), default_text)
00054         obj.setAtextfield('Bla', filename='name.rst')
00055         self.assertEqual(field.getFilename(obj), 'name.rst')
00056         self.assertEqual(field.getRaw(obj), 'Bla')

Definition at line 57 of file test_filename.py.

00057 
00058     def test_textfieldwithfilename2(self):
00059         obj = self._dummy
00060         field = obj.getField('atextfield')
00061         obj.setAtextfield('Ble', filename='eitadiacho.txt')
00062         self.assertEqual(field.getRaw(obj), 'Ble')
00063         self.assertEqual(field.getFilename(obj), 'eitadiacho.txt')

Definition at line 64 of file test_filename.py.

00064 
00065     def test_textfieldwithoutfilename(self):
00066         obj = self._dummy
00067         field = obj.getField('atextfield')
00068         obj.setAtextfield('Bli')
00069         self.assertEqual(str(field.getRaw(obj)), 'Bli')
00070         self.assertEqual(field.getFilename(obj), '')


Member Data Documentation

Definition at line 45 of file test_filename.py.


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