George,

I've accepted your changes and merged your pull request on
Bitbucket.  Thanks for that.

I've some more testing to do on a very minor change that I've made.
And, I'd also like to create a unit test for your "one per"
capability.  I may have a question or two while working on that.

Then I'll create a new release.

Let me know when/if you have more changes.

Thanks again for your work on this.

Dave

> 
> Subject: Re: [Generateds-users] Change to add explicit namespace to export
>       children breaks unit tests
> Date: Tue, 4 Feb 2014 11:24:46 -0700
> From: George David <geo...@miamisalsa.com>
> To: generateds-users <generateds-users@lists.sourceforge.net>
> 
>    Hi Dave,
>    I have completed my changes. With the change added to
>    GentTest.execute(), here are the results of the unit tests:
>    test_001_compare_superclasses (__main__.GenTest) ... ok
>    test_003_element_groups (__main__.GenTest) ... ERROR
>    test_004_valueof (__main__.GenTest) ... ERROR
>    test_005_ns_for_import (__main__.GenTest) ... ok
>    test_006_anysimpletype (__main__.GenTest) ... ok
>    test_007_simpletype_memberspecs (__main__.GenTest) ... ok
>    test_008_extensions (__main__.GenTest) ... ok
>    test_009_literal (__main__.GenTest) ... ok
>    test_010_simplecontent_restriction (__main__.GenTest) ... ERROR
>    test_011_annotations (__main__.GenTest) ... ok
>    test_012_abstracttype (__main__.GenTest) ... ok
>    test_013_procincl (__main__.GenTest) ... ok
>    test_014_xsi_type (__main__.GenTest) ... ERROR
>    test_015_recursive_simpletype (__main__.GenTest) ... ok
>    test_016_anywildcard (__main__.GenTest) ... ok
>    test_017_attr_groups (__main__.GenTest) ... ERROR
>    test_018_simpletypes_other (__main__.GenTest) ... FAIL
>    test_019_to_etree (__main__.GenTest) ... FAIL
>    test_020_catalogtest (__main__.GenTest) ... ERROR
>    test_021_anonymous_type (__main__.GenTest) ... ok
>    ======================================================================
>    ERROR: test_003_element_groups (__main__.GenTest)
>    ----------------------------------------------------------------------
>    Traceback (most recent call last):
>      File "test.py", line 71, in test_003_element_groups
>        result, err = self.execute(cmd, cwd='..')
>      File "test.py", line 19, in execute
>        raise Exception(stderr)
>    Exception: Traceback (most recent call last):
>      File "generateDS.py", line 6286, in <module>
>        main()
>      File "generateDS.py", line 6274, in main
>        processIncludes, superModule=superModule)
>      File "generateDS.py", line 5882, in parseAndGenerate
>        fixtypenames=FixTypeNames)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 64, in process_include_files
>        prep_schema_doc(infile, outfile, inpath, options)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 288, in prep_schema_doc
>        raise_anon_complextypes(root2)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 452, in raise_anon_complextypes
>        defs = root.xpath(pattern, namespaces=Namespaces)
>      File "lxml.etree.pyx", line 1477, in lxml.etree._Element.xpath
>    (src/lxml/lxml.etree.c:46634)
>      File "xpath.pxi", line 322, in
>    lxml.etree.XPathElementEvaluator.__call__
>    (src/lxml/lxml.etree.c:132785)
>      File "xpath.pxi", line 242, in
>    lxml.etree._XPathEvaluatorBase._handle_result
>    (src/lxml/lxml.etree.c:131890)
>      File "xpath.pxi", line 227, in
>    lxml.etree._XPathEvaluatorBase._raise_eval_error
>    (src/lxml/lxml.etree.c:131718)
>    lxml.etree.XPathEvalError: Undefined namespace prefix
>    ======================================================================
>    ERROR: test_004_valueof (__main__.GenTest)
>    ----------------------------------------------------------------------
>    Traceback (most recent call last):
>      File "test.py", line 109, in test_004_valueof
>        result, err = self.execute(cmd, cwd='..')
>      File "test.py", line 19, in execute
>        raise Exception(stderr)
>    Exception: Traceback (most recent call last):
>      File "generateDS.py", line 6286, in <module>
>        main()
>      File "generateDS.py", line 6274, in main
>        processIncludes, superModule=superModule)
>      File "generateDS.py", line 5882, in parseAndGenerate
>        fixtypenames=FixTypeNames)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 64, in process_include_files
>        prep_schema_doc(infile, outfile, inpath, options)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 288, in prep_schema_doc
>        raise_anon_complextypes(root2)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 452, in raise_anon_complextypes
>        defs = root.xpath(pattern, namespaces=Namespaces)
>      File "lxml.etree.pyx", line 1477, in lxml.etree._Element.xpath
>    (src/lxml/lxml.etree.c:46634)
>      File "xpath.pxi", line 322, in
>    lxml.etree.XPathElementEvaluator.__call__
>    (src/lxml/lxml.etree.c:132785)
>      File "xpath.pxi", line 242, in
>    lxml.etree._XPathEvaluatorBase._handle_result
>    (src/lxml/lxml.etree.c:131890)
>      File "xpath.pxi", line 227, in
>    lxml.etree._XPathEvaluatorBase._raise_eval_error
>    (src/lxml/lxml.etree.c:131718)
>    lxml.etree.XPathEvalError: Undefined namespace prefix
>    ======================================================================
>    ERROR: test_010_simplecontent_restriction (__main__.GenTest)
>    ----------------------------------------------------------------------
>    Traceback (most recent call last):
>      File "test.py", line 262, in test_010_simplecontent_restriction
>        result, _ = self.execute(cmd, cwd='..')
>      File "test.py", line 19, in execute
>        raise Exception(stderr)
>    Exception: Traceback (most recent call last):
>      File "generateDS.py", line 6286, in <module>
>        main()
>      File "generateDS.py", line 6274, in main
>        processIncludes, superModule=superModule)
>      File "generateDS.py", line 5882, in parseAndGenerate
>        fixtypenames=FixTypeNames)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 64, in process_include_files
>        prep_schema_doc(infile, outfile, inpath, options)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 288, in prep_schema_doc
>        raise_anon_complextypes(root2)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 452, in raise_anon_complextypes
>        defs = root.xpath(pattern, namespaces=Namespaces)
>      File "lxml.etree.pyx", line 1477, in lxml.etree._Element.xpath
>    (src/lxml/lxml.etree.c:46634)
>      File "xpath.pxi", line 322, in
>    lxml.etree.XPathElementEvaluator.__call__
>    (src/lxml/lxml.etree.c:132785)
>      File "xpath.pxi", line 242, in
>    lxml.etree._XPathEvaluatorBase._handle_result
>    (src/lxml/lxml.etree.c:131890)
>      File "xpath.pxi", line 227, in
>    lxml.etree._XPathEvaluatorBase._raise_eval_error
>    (src/lxml/lxml.etree.c:131718)
>    lxml.etree.XPathEvalError: Undefined namespace prefix
>    ======================================================================
>    ERROR: test_014_xsi_type (__main__.GenTest)
>    ----------------------------------------------------------------------
>    Traceback (most recent call last):
>      File "test.py", line 331, in test_014_xsi_type
>        result, _ = self.execute(cmd, cwd='..')
>      File "test.py", line 19, in execute
>        raise Exception(stderr)
>    Exception: Traceback (most recent call last):
>      File "generateDS.py", line 6286, in <module>
>        main()
>      File "generateDS.py", line 6274, in main
>        processIncludes, superModule=superModule)
>      File "generateDS.py", line 5882, in parseAndGenerate
>        fixtypenames=FixTypeNames)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 64, in process_include_files
>        prep_schema_doc(infile, outfile, inpath, options)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 282, in prep_schema_doc
>        collect_inserts(root1, params, inserts, options)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 213, in collect_inserts
>        aux_roots = collect_inserts_aux(child, params, inserts, options)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 222, in collect_inserts_aux
>        string_content = resolve_ref(child, params, options)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 199, in resolve_ref
>        raise SchemaIOError(msg)
>    process_includes.SchemaIOError: Can't find file tests/address.xsd
>    referenced in <open file 'tests/ipo.xsd', mode 'r' at 0x2651150>.
>    ======================================================================
>    ERROR: test_017_attr_groups (__main__.GenTest)
>    ----------------------------------------------------------------------
>    Traceback (most recent call last):
>      File "test.py", line 391, in test_017_attr_groups
>        result, _ = self.execute(cmd, cwd='..')
>      File "test.py", line 19, in execute
>        raise Exception(stderr)
>    Exception: Traceback (most recent call last):
>      File "generateDS.py", line 6286, in <module>
>        main()
>      File "generateDS.py", line 6274, in main
>        processIncludes, superModule=superModule)
>      File "generateDS.py", line 5882, in parseAndGenerate
>        fixtypenames=FixTypeNames)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 64, in process_include_files
>        prep_schema_doc(infile, outfile, inpath, options)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 288, in prep_schema_doc
>        raise_anon_complextypes(root2)
>      File "/views/generateDs/code/generateds-fork/process_includes.py",
>    line 452, in raise_anon_complextypes
>        defs = root.xpath(pattern, namespaces=Namespaces)
>      File "lxml.etree.pyx", line 1477, in lxml.etree._Element.xpath
>    (src/lxml/lxml.etree.c:46634)
>      File "xpath.pxi", line 322, in
>    lxml.etree.XPathElementEvaluator.__call__
>    (src/lxml/lxml.etree.c:132785)
>      File "xpath.pxi", line 242, in
>    lxml.etree._XPathEvaluatorBase._handle_result
>    (src/lxml/lxml.etree.c:131890)
>      File "xpath.pxi", line 227, in
>    lxml.etree._XPathEvaluatorBase._raise_eval_error
>    (src/lxml/lxml.etree.c:131718)
>    lxml.etree.XPathEvalError: Undefined namespace prefix
>    ======================================================================
>    ERROR: test_020_catalogtest (__main__.GenTest)
>    ----------------------------------------------------------------------
>    Traceback (most recent call last):
>      File "test.py", line 459, in test_020_catalogtest
>        result, _ = self.execute(cmd, cwd='..')
>      File "test.py", line 19, in execute
>        raise Exception(stderr)
>    Exception: Traceback (most recent call last):
>      File "generateDS.py", line 6286, in <module>
>        main()
>      File "generateDS.py", line 6274, in main
>        processIncludes, superModule=superModule)
>      File "generateDS.py", line 5867, in parseAndGenerate
>        infile = open(xschemaFileName, 'r')
>    IOError: [Errno 2] No such file or directory: 'tests/catalogtest.xsd'
>    ======================================================================
>    FAIL: test_018_simpletypes_other (__main__.GenTest)
>    ----------------------------------------------------------------------
>    Traceback (most recent call last):
>      File "test.py", line 412, in test_018_simpletypes_other
>        self.check_result(result, err, ('sys.stdout.write',))
>      File "test.py", line 486, in check_result
>        self.failUnlessEqual(len(result), 0)
>    AssertionError: 469 != 0
>    ======================================================================
>    FAIL: test_019_to_etree (__main__.GenTest)
>    ----------------------------------------------------------------------
>    Traceback (most recent call last):
>      File "test.py", line 431, in test_019_to_etree
>        self.check_result(result, err, ('sys.stdout.write',))
>      File "test.py", line 486, in check_result
>        self.failUnlessEqual(len(result), 0)
>    AssertionError: 7739 != 0
>    ----------------------------------------------------------------------
>    Ran 20 tests in 4.144s
>    FAILED (failures=2, errors=6)
>    I'll commit it now and submit a pull request.
>    Thanks,
>    George
> 
>    On Tue, Feb 4, 2014 at 11:06 AM, George David
>    <[1]geo...@miamisalsa.com> wrote:
> 
>    Hi Dave,
>    I see there are already 6 failing unit tests.
>    FAIL: test_003_element_groups (__main__.GenTest)
>    FAIL: test_004_valueof (__main__.GenTest)
>    FAIL: test_010_simplecontent_restriction (__main__.GenTest)
>    FAIL: test_018_simpletypes_other (__main__.GenTest)
>    FAIL: test_019_to_etree (__main__.GenTest)
>    FAIL: test_020_catalogtest (__main__.GenTest)
>    As best I can tell, these are failing now as they were before my
>    change.
>    With my changes there are 9 more unit tests failing:
>    FAIL: test_006_anysimpletype (__main__.GenTest)
>    FAIL: test_007_simpletype_memberspecs (__main__.GenTest)
>    FAIL: test_008_extensions (__main__.GenTest)
>    FAIL: test_011_annotations (__main__.GenTest)
>    FAIL: test_012_abstracttype (__main__.GenTest)
>    FAIL: test_013_procincl (__main__.GenTest)
>    FAIL: test_015_recursive_simpletype (__main__.GenTest)
>    FAIL: test_016_anywildcard (__main__.GenTest)
>    FAIL: test_021_anonymous_type (__main__.GenTest)
>    In order to help me figure out what's wrong, I added this bit of code
>    to GenTest.execute() after the p.communicate() function.
>             if stderr:
>                 raise Exception(stderr)
>    This causes 2 new failures:
>    ERROR: test_014_xsi_type (__main__.GenTest)
>    ERROR: test_017_attr_groups (__main__.GenTest)
>    It appears these tests haven't worked for some time. The reason they
>    aren't failing is because the result is checked in to the source. So if
>    the command fails, the result file is still there and valid.
>    I'll fix the tests I broke and leave these new ones in and the old
>    previously breaking ones. In other words, I'll leave these as failing:
>    |FAIL: test_003_element_groups (__main__.GenTest)
>    FAIL: test_004_valueof (__main__.GenTest)
>    FAIL: test_010_simplecontent_restriction (__main__.GenTest)
>    FAIL: test_018_simpletypes_other (__main__.GenTest)
>    FAIL: test_019_to_etree (__main__.GenTest)
>    FAIL: test_020_catalogtest (__main__.GenTest)
>    ERROR: test_014_xsi_type (__main__.GenTest)
>    ERROR: test_017_attr_groups (__main__.GenTest)
>    I will also check in my change to GenTest.execute() so failing tests
>    don't accidentally get ignored.
>    Once complete I'll submit a pull request.
>    Thanks,
>    George
> 
> References
> 
>    1. mailto:geo...@miamisalsa.com
> 
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> generateds-users mailing list
> generateds-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/generateds-users
> 
> 

-- 

Dave Kuhlman
http://www.davekuhlman.org

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to