;ò ðX‡>c@sêdZddd!Zddd!Zddd!ZdkZdkZedjo$eeii eid d ƒƒnd k l Z e i d ƒd k lZde i fd„ƒYZedjoeddddƒndkZd„ZdS(s $RCSfile: XSLTChallenges.py,v $ Some tests for compliance of XSLT processors Edge cases, areas where the spec is unclear, and processors are likely to break or produce widely differing results Author: Craeg Strong Release: 1.0 s $Name: $iiþÿÿÿs$Date: 2003/03/30 20:51:59 $s$Revision: 1.4 $i Ns__main__is framework.py(s ZopeTestCasesZopeXMLMethods(sProcessorChoosersXSLTChallengesTestCasecBsDtZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s’ XSLT Processor challenge cases. This is particularly useful to test the differences between XSLT processors, for example between Pyana and different releases of 4Suite. This file is not included in the automated test suite, rather it is invoked by hand. The reason is that these edge cases or pathological cases will rarely or never be encountered in actual practice. cCsX|iid}tƒ|_|iiƒ|_t|iƒdjot dƒ‚ndS(sAdd object to default fixturesZopeXMLMethodsis)Error: no supported XSLT Processors foundN( sselfsfoldersmanage_addProductsprodsProcessorChooserschoosers processorss processorListslens Exception(sselfsprod((sR/mnt/gmirror/ports/www/zope-xmlmethods/work/ZopeXMLMethods/tests/XSLTChallenges.pys afterSetUp,s  cCs$y |`Wntj onXdS(sClean up after myselfN(sselfsprodsAttributeError(sself((sR/mnt/gmirror/ports/www/zope-xmlmethods/work/ZopeXMLMethods/tests/XSLTChallenges.pys afterClear7s  c Cs¥tddƒ}|iƒ}tddƒ}|iƒ}Hxg|iD]\}dG|G|i i |ƒ}|i |d|dt t t ƒ}|i|iƒdƒdGHqAWdS( s7Test that the processor supports EXSLT func dyn:evalutestestfiles/evaluate.xmlsrbstestfiles/dynevaluate.xslsTesting processorss Hello, worlds...okN(sopensxmlFilesreads xmlContentssxsltFiles xsltContentssselfs processorListsnameschoosersprocessorObjects processors transformGutssNonesresults assertEqualssstrip(sselfs xsltContentssxmlFilesnames xmlContentssxsltFilesresults processor((sR/mnt/gmirror/ports/www/zope-xmlmethods/work/ZopeXMLMethods/tests/XSLTChallenges.pystest_01@s   c Cs›tddƒ}|iƒ}tddƒ}|iƒ}Hx]|iD]R}dG|GH|i i |ƒ}|i |d|dt t t ƒ}|iƒGHdGHqAWdS(sCTest that the processor supports namespaces in attributes edgecasesstestfiles/simple.xmlsrbstestfiles/namespaces.xslsTesting processorss...okN(sopensxmlFilesreads xmlContentssxsltFiles xsltContentssselfs processorListsnameschoosersprocessorObjects processors transformGutssNonesresultsstrip(sselfs xsltContentssxmlFilesnames xmlContentssxsltFilesresults processor((sR/mnt/gmirror/ports/www/zope-xmlmethods/work/ZopeXMLMethods/tests/XSLTChallenges.pystest_02Qs     c Cs\g}g}tddƒ}|i|iƒƒtddƒ}|i|iƒƒtddƒ}|i|iƒƒtddƒ}|i|iƒƒtddƒ}|i|iƒƒtddƒ}|i|iƒƒHx|tdƒD]n}xe|i D]Z}dG|GH|i i |ƒ}|i||d ||d tttƒ}|iƒGHd GHqöWqæWd S( sTest self:: axis stuffstestfiles/selftest1.xmlsrbstestfiles/selftest2.xmlstestfiles/selftest1.xslstestfiles/selftest2.xslstestfiles/selftest3.xslisTesting processorss...okN(s xmlContentss xsltContentssopensxmlFilesappendsreadsxsltFilesrangesisselfs processorListsnameschoosersprocessorObjects processors transformGutssNonesresultsstrip( sselfs xsltContentssxmlFilesnames xmlContentssisxsltFilesresults processor((sR/mnt/gmirror/ports/www/zope-xmlmethods/work/ZopeXMLMethods/tests/XSLTChallenges.pystest_03bs6     c Cs›tddƒ}|iƒ}tddƒ}|iƒ}Hx]|iD]R}dG|GH|i i |ƒ}|i |d|dt t t ƒ}|iƒGHdGHqAWdS(sTest namespace stuffstestfiles/selftest1.xmlsrbstestfiles/bar.xslsTesting processorss...okN(sopensxmlFilesreads xmlContentssxsltFiles xsltContentssselfs processorListsnameschoosersprocessorObjects processors transformGutssNonesresultsstrip(sselfs xsltContentssxmlFilesnames xmlContentssxsltFilesresults processor((sR/mnt/gmirror/ports/www/zope-xmlmethods/work/ZopeXMLMethods/tests/XSLTChallenges.pystest_04s     ( s__name__s __module__s__doc__s afterSetUps afterClearstest_01stest_02stest_03stest_04(((sR/mnt/gmirror/ports/www/zope-xmlmethods/work/ZopeXMLMethods/tests/XSLTChallenges.pysXSLTChallengesTestCases    s descriptionsis verbosityicCs*tiƒ}|ititƒƒ|SdS(N(sunittests TestSuitessuitesaddTests makeSuitesXSLTChallengesTestCase(ssuite((sR/mnt/gmirror/ports/www/zope-xmlmethods/work/ZopeXMLMethods/tests/XSLTChallenges.pys test_suitešs (s__doc__s __cvstag__s__date__s __version__sosssyss__name__sexecfilespathsjoinsTestings ZopeTestCasesinstallProducts(Products.ZopeXMLMethods.ProcessorChoosersProcessorChoosersXSLTChallengesTestCases frameworksunittests test_suite( s__date__sXSLTChallengesTestCases ZopeTestCasesunittestsProcessorChoosers __cvstag__s test_suitessyss __version__sos((sR/mnt/gmirror/ports/www/zope-xmlmethods/work/ZopeXMLMethods/tests/XSLTChallenges.pys? s    $   x