示例#1
0
def test_suite():
    import unittest
    from Testing.ZopeTestCase import FunctionalDocFileSuite
    suite = unittest.TestSuite()
    suite.addTest(FunctionalDocFileSuite('doc/README.txt',
                                         package='Products.Marshall',
                                         test_class=DocumentationTest))

    ## XXX: reenable Blob and Image tests
    #suite.addTest(unittest.makeSuite(ATXMLReferenceMarshallTest))
    #suite.addTest(unittest.makeSuite(BlobMarshallTest))
    dirs = glob.glob(os.path.join(PACKAGE_HOME, 'input', '*'))
    comps = [i['name'] for i in getRegisteredComponents()]
    for d in dirs:
        prefix = os.path.basename(d)
        if prefix not in comps:
            continue
        files = glob.glob(os.path.join(d, '*'))
        for f in files:
            if os.path.isdir(f):
                continue
            f_name = os.path.basename(f)
            type_name = os.path.splitext(f_name)[0]
            k_dict = {'prefix':prefix,
                      'type_name':type_name,
                      'input':f}
            klass = type('%s%sTest' % (prefix, type_name),
                         (MarshallerTest,),
                         k_dict)
            suite.addTest(unittest.makeSuite(klass))
    return suite
示例#2
0
 def setComponentName(self, component_name):
     """ Change the component name """
     valid_components = [i['name'] for i in getRegisteredComponents()]
     if component_name not in valid_components:
         raise ValueError('Not a valid registered '
                          'component: %s' % component_name)
     self._component_name = component_name
示例#3
0
 def setComponentName(self, component_name):
     """ Change the component name """
     valid_components = [i['name'] for i in getRegisteredComponents()]
     if component_name not in valid_components:
         raise ValueError('Not a valid registered '
                          'component: %s' % component_name)
     self._component_name = component_name
示例#4
0
文件: test_export.py 项目: a25kk/stv2
def test_suite():
    import unittest

    suite = unittest.TestSuite()
    dirs = glob.glob(os.path.join(PACKAGE_HOME, "export", "*"))
    comps = [i["name"] for i in getRegisteredComponents()]
    for d in dirs:
        prefix = os.path.basename(d)
        if prefix not in comps:
            continue
        k_dict = {"base": d, "prefix": prefix}
        klass = type("%sExportTest" % prefix, (ExportTest,), k_dict)
        suite.addTest(unittest.makeSuite(klass))
    return suite
示例#5
0
def test_suite():
    import unittest
    suite = unittest.TestSuite()
    dirs = glob.glob(os.path.join(PACKAGE_HOME, 'export', '*'))
    comps = [i['name'] for i in getRegisteredComponents()]
    for d in dirs:
        prefix = os.path.basename(d)
        if prefix not in comps:
            continue
        k_dict = {'base':d,
                  'prefix':prefix}
        klass = type('%sExportTest' % prefix,
                     (ExportTest,),
                     k_dict)
        suite.addTest(unittest.makeSuite(klass))
    return suite
示例#6
0
def test_suite():
    import unittest
    suite = unittest.TestSuite()
    dirs = glob.glob(os.path.join(PACKAGE_HOME, 'export', '*'))
    comps = [i['name'] for i in getRegisteredComponents()]
    for d in dirs:
        prefix = os.path.basename(d)
        if prefix not in comps:
            continue
        k_dict = {'base':d,
                  'prefix':prefix}
        klass = type('%sExportTest' % prefix,
                     (ExportTest,),
                     k_dict)
        suite.addTest(unittest.makeSuite(klass))
    return suite
示例#7
0
def manage_availableComponents(self):
    return getRegisteredComponents()
示例#8
0
def manage_availableComponents(self):
    return getRegisteredComponents()