diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-09-02 23:30:21 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-09-02 23:31:11 +0200 |
commit | 53c5c50bb69de718893ca8eee41ca0a48dd00fda (patch) | |
tree | a1cfd0dfad41b07b19849b9547c6276c6d32729e /tests | |
parent | dfe813291aa08e60cc5174be72580daefe8cbe7e (diff) | |
download | clufter-53c5c50bb69de718893ca8eee41ca0a48dd00fda.tar.gz clufter-53c5c50bb69de718893ca8eee41ca0a48dd00fda.tar.xz clufter-53c5c50bb69de718893ca8eee41ca0a48dd00fda.zip |
filter{,_manager}: filter responsible for resolving self
... against the passed formats
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ccs2needle_xslt.py | 8 | ||||
-rw-r--r-- | tests/command.py | 11 | ||||
-rw-r--r-- | tests/filter.py | 6 | ||||
-rw-r--r-- | tests/filter_manager.py | 5 |
4 files changed, 16 insertions, 14 deletions
diff --git a/tests/ccs2needle_xslt.py b/tests/ccs2needle_xslt.py index b697683..d71b7e0 100644 --- a/tests/ccs2needle_xslt.py +++ b/tests/ccs2needle_xslt.py @@ -13,9 +13,9 @@ from lxml import etree import _bootstrap # known W402, required -from clufter.formats.ccs import ccs -from clufter.formats.coro import coroxml from clufter.filter import XMLFilter +from clufter.format import formats +formats = formats.plugins from clufter.utils_prog import dirname_x #WALK_DIR = join(dirname_x(__file__, 2), 'filters', 'cluster') @@ -24,8 +24,8 @@ WALK_DIR = join(dirname_x(__file__, 2), 'filters') class Ccs2NeedleXsltViewOnly(unittest.TestCase): def testXSLTTemplate2(self): - flt = XMLFilter(ccs, coroxml) - in_obj = ccs('file', join(dirname(__file__), 'filled.conf')) + flt = XMLFilter(formats) + in_obj = formats['ccs']('file', join(dirname(__file__), 'filled.conf')) r = flt.get_template(in_obj, symbol='ccs2needlexml', root_dir=WALK_DIR) diff --git a/tests/command.py b/tests/command.py index 2019dfa..693bd37 100644 --- a/tests/command.py +++ b/tests/command.py @@ -18,18 +18,17 @@ from clufter.filters.ccs2flatccs import ccs2flatccs from clufter.filters.flatccs2pcs import flatccs2pcs from clufter.filters.ccs2coro import ccs2needlexml -from clufter.formats.ccs import ccs, flatccs -from clufter.formats.coro import coroxml -from clufter.formats.pcs import pcs +from clufter.format import formats +formats = formats.plugins class ChainResolve(unittest.TestCase): def testShapeAndProtocolMatch(self): from tempfile import mktemp filters = dict( - ccs2flatccs=ccs2flatccs(ccs, flatccs), - flatccs2pcs=flatccs2pcs(flatccs, pcs), - ccs2coroxml=ccs2needlexml(ccs, coroxml), + ccs2flatccs=ccs2flatccs(formats), + flatccs2pcs=flatccs2pcs(formats), + ccs2coroxml=ccs2needlexml(formats), ) testfile = join(dirname(__file__), 'empty.conf') testoutput = mktemp(prefix='out', suffix='.conf', diff --git a/tests/filter.py b/tests/filter.py index e5f84c2..00270a1 100644 --- a/tests/filter.py +++ b/tests/filter.py @@ -13,6 +13,8 @@ from lxml import etree import _bootstrap # known W402, required +from clufter.format import formats +formats = formats.plugins from clufter.formats.ccs import ccs from clufter.filter import XMLFilter @@ -36,7 +38,7 @@ def fnc(symbol, elem, children): class XMLTraverse(unittest.TestCase): def testDirectXSLT(self): - flt = XMLFilter(ccs, ccs) + flt = XMLFilter(formats) in_obj = ccs('file', join(dirname(__file__), 'filled.conf')) r = flt.proceed_xslt(in_obj, symbol='direct_xslt_test', root_dir=join(dirname(__file__), 'XMLFormat-walk')) @@ -49,7 +51,7 @@ class XMLTraverse(unittest.TestCase): self.assertTrue(etree.tostring(r) == RESULT_DIRECT_XSLT) def testXSLTTemplate(self): - flt = XMLFilter(ccs, ccs) + flt = XMLFilter(formats) in_obj = ccs('file', join(dirname(__file__), 'filled.conf')) r = flt.get_template(in_obj, symbol='direct_xslt_test', root_dir=WALK_DIR) diff --git a/tests/filter_manager.py b/tests/filter_manager.py index 9aa9fa6..4b33987 100644 --- a/tests/filter_manager.py +++ b/tests/filter_manager.py @@ -11,6 +11,8 @@ from os.path import dirname, join import _bootstrap # known W402, required from clufter.format_manager import FormatManager +from clufter.format import formats +formats = formats.plugins from clufter.filter import Filter from clufter.filter_manager import FilterManager from clufter.utils import head_tail @@ -58,8 +60,7 @@ class CompositeFormatIO(FilterManagerTestCase): @Filter.deco(('ccs', 'ccs'), ('flatccs', 'flatccs')) def double_ccs2flatccs(flt_ctxt, in_objs, verify=False): from clufter.filters.ccs2flatccs import ccs2flatccs - from clufter.formats.ccs import ccs, flatccs - ccs2flatccs = ccs2flatccs(ccs, flatccs) + ccs2flatccs = ccs2flatccs(formats) outs = [] for in_obj in in_objs: outs.append(('bytestring', ccs2flatccs(in_obj)('bytestring'))) |