Back to index

plone3  3.1.7
Public Member Functions
CMFCore.tests.test_FSPythonScript.FSPythonScriptTests Class Reference
Inheritance diagram for CMFCore.tests.test_FSPythonScript.FSPythonScriptTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_FSPythonScript.FSPythonScriptTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_get_size
def test_initialization_race_condition
def test_foreign_line_endings

Detailed Description

Definition at line 48 of file test_FSPythonScript.py.


Member Function Documentation

Definition at line 76 of file test_FSPythonScript.py.

00076 
00077     def test_foreign_line_endings( self ):
00078         # Load the various line ending files and get their output
00079         container = Folder('container_for_execution')
00080         for fformat in ('unix', 'dos', 'mac'):
00081             container._setObject(fformat,
00082                 self._makeOne(fformat, 'test_%s.py' % fformat))
00083             script = getattr(container, fformat)
00084             self.assertEqual(script(), fformat)
00085 

Here is the call graph for this function:

Definition at line 50 of file test_FSPythonScript.py.

00050 
00051     def test_get_size( self ):
00052         # Test get_size returns correct value
00053         script = self._makeOne('test1', 'test1.py')
00054         self.assertEqual(len(script.read()),script.get_size())

Here is the call graph for this function:

Definition at line 55 of file test_FSPythonScript.py.

00055 
00056     def test_initialization_race_condition(self):
00057         # Tries to exercise a former race condition where
00058         # FSObject._updateFromFS() set self._parsed before the
00059         # object was really parsed.
00060         for n in range(10):
00061             f = Folder()
00062             script = self._makeOne('test1', 'test1.py').__of__(f)
00063             res = []
00064 
00065             def call_script(script=script, res=res):
00066                 try:
00067                     res.append(script())
00068                 except:
00069                     res.append('%s: %s' % exc_info()[:2])
00070 
00071             start_new_thread(call_script, ())
00072             call_script()
00073             while len(res) < 2:
00074                 sleep(0.05)
00075             self.assertEqual(res, ['test1', 'test1'], res)

Here is the call graph for this function:


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