Changeset 2626


Ignore:
Timestamp:
May 18, 2010 5:39:16 PM (11 years ago)
Author:
wehart
Message:

Fixes to get the YAML plugin to be recognized.

Location:
coopr.testing/trunk/coopr/testing
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • coopr.testing/trunk/coopr/testing/driver.py

    r2625 r2626  
     1
     2__all__ = ['main', 'create_test_suite']
    13
    24import os
     
    46import optparse
    57import plugins
    6 from pyutilib.component.core import ExtensionPoint
     8from pyutilib.component.core import ExtensionPoint, PluginGlobals
     9
     10
     11def create_test_suite(filename):
     12    ep = ExtensionPoint(plugins.ITestDriver)
     13    ftype = os.path.splitext(filename)[1]
     14    if not ftype == '':
     15        ftype = ftype[1:]
     16    service = ep.service(ftype)
     17    if service is None:
     18        raise IOError, "Unknown file type.  Cannot load suites from file '%s'" % filename
     19    suite = service.load_test_suite(filename)
    720
    821
     
    2235        return
    2336
    24     ep = ExtensionPoint(plugins.ITestDriver)
    25     print "HERE",len(ep)
    26     for file in args:
    27         ftype = os.path.splitext(file)[1]
    28         print "HERE",ftype,ep(ftype)
    29         suite = ep(ftype).load_test_specification(file)
    30         suite = ep(ftype).load_test_specification(file)
    31         print suite
     37    for file in args[1:]:
     38        create_test_suite(file)
    3239       
    3340       
  • coopr.testing/trunk/coopr/testing/plugins.py

    r2625 r2626  
    66class ITestDriver(Interface):
    77
    8     def load_test_suites(self, filename):
     8    def load_test_suite(self, filename):
    99        pass
    1010
  • coopr.testing/trunk/coopr/testing/yaml_plugin.py

    r2625 r2626  
    1010
    1111
    12 class YamlTestDriver(Plugin):
     12class YamlTestDriver(SingletonPlugin):
    1313
    1414    implements(plugins.ITestDriver)
    1515
    1616    def __init__(self, **kwds):
    17         Plugin.__init__(self, **kwds)
    18         self.name='yaml'
     17        SingletonPlugin.__init__(self, **kwds)
     18        self.name='yml'
    1919
    20     def load_test_specification(self, filename):
     20    def load_test_suite(self, filename):
    2121        INPUT = open(filename, 'r')
    2222        repn = yaml.load(INPUT, yaml.SafeLoader)
Note: See TracChangeset for help on using the changeset viewer.