Back to index

plone3  3.1.7
Classes | Functions | Variables
Marshall.tests.test_marshall Namespace Reference

Classes

class  MarshallerTest
class  ATXMLReferenceMarshallTest
class  BlobMarshallTest
class  DocumentationTest

Functions

def get_data
def exception
def setBody
def _traceback
def test_suite

Variables

 tool_id = Registry.id
 orig_exception = HTTPResponse.exception
 orig_setBody = HTTPResponse.setBody

Function Documentation

def Marshall.tests.test_marshall._traceback (   self,
  t,
  v,
  tb,
  as_html = 1 
) [private]

Definition at line 497 of file test_marshall.py.

00497 
00498 def _traceback(self, t, v, tb, as_html=1):
00499     return ''.join(format_exception(t, v, tb, as_html=as_html))
00500 
00501 HTTPResponse._error_format = 'text/plain'
00502 HTTPResponse._traceback = _traceback
00503 HTTPResponse.exception = exception
00504 HTTPResponse.setBody = setBody

def Marshall.tests.test_marshall.exception (   self,
  kw 
)

Definition at line 483 of file test_marshall.py.

00483 
00484 def exception(self, **kw):
00485     def tag_search(*args):
00486         return False
00487     kw['tag_search'] = tag_search
00488     return orig_exception(self, **kw)

Definition at line 46 of file test_marshall.py.

00046 
00047 def get_data(fname):
00048     return open(os.path.join(PACKAGE_HOME, 'data', fname), 'rb').read()

Here is the caller graph for this function:

def Marshall.tests.test_marshall.setBody (   self,
  args,
  kw 
)

Definition at line 490 of file test_marshall.py.

00490 
00491 def setBody(self, *args, **kw):
00492     kw['is_error'] = 0
00493     if len(args[0]) == 2:
00494         title, body = args[0]
00495         args = (body,) + args[1:]
00496     return orig_setBody(self, *args, **kw)

Definition at line 514 of file test_marshall.py.

00514 
00515 def test_suite():
00516     import unittest
00517     from Testing.ZopeTestCase import FunctionalDocFileSuite
00518     suite = unittest.TestSuite()
00519     suite.addTest(FunctionalDocFileSuite('doc/README.txt',
00520                                          package='Products.Marshall',
00521                                          test_class=DocumentationTest))
00522 
00523     ## XXX: reenable Blob and Image tests
00524     #suite.addTest(unittest.makeSuite(ATXMLReferenceMarshallTest))
00525     #suite.addTest(unittest.makeSuite(BlobMarshallTest))
00526     dirs = glob.glob(os.path.join(PACKAGE_HOME, 'input', '*'))
00527     comps = [i['name'] for i in getRegisteredComponents()]
00528     for d in dirs:
00529         prefix = os.path.basename(d)
00530         if prefix not in comps:
00531             continue
00532         files = glob.glob(os.path.join(d, '*'))
00533         for f in files:
00534             if os.path.isdir(f):
00535                 continue
00536             f_name = os.path.basename(f)
00537             type_name = os.path.splitext(f_name)[0]
00538             k_dict = {'prefix':prefix,
00539                       'type_name':type_name,
00540                       'input':f}
00541             klass = type('%s%sTest' % (prefix, type_name),
00542                          (MarshallerTest,),
00543                          k_dict)
00544             suite.addTest(unittest.makeSuite(klass))
00545     return suite

Here is the call graph for this function:


Variable Documentation

Definition at line 482 of file test_marshall.py.

Definition at line 489 of file test_marshall.py.

Definition at line 44 of file test_marshall.py.