Commit Graph

22 Commits

Author SHA1 Message Date
Davide Brunato 844ddec3ba Fix assertions
- Add custom parser for assertion facet (without position() and last()).
  - Move parser initialization to XsdAssert.parse_xpath_test() because
    all the components must be defined.
2019-10-01 06:44:31 +02:00
Davide Brunato 07070ad714 Fix W3C instance tests
- Add iter_substitutes() to Xsd11Element to fix upa.xsd/upa2.xsd
    tests with instances. Now for XsdElement the abstract substitutes
    are simply ignored by iter_substitutes().
2019-09-11 18:43:13 +02:00
Davide Brunato 52d1e1bb8e Close XSD 1.1 development
- Still some W3C and local tests to be fixed
  - Fix min/max facets derivation (decode with primitive type)
2019-08-05 17:57:34 +02:00
Davide Brunato 6994da5173 Code refactoring for tests
- Rename XMLSchemaTestCase to XsdValidatorTestCase
  - Add casepath() helper
  - Modify TestResources: derive from TestCase and use casepath()
  - Split test_package.py into 3 modules (added test_etree.py and
    test_memory.py)
  - Update .tox with new environments 'package' and 'memory'
  - Replace test_package with test_etree into test_all.py script
  - Modify XsdValidatorTestCase.check_schema() to use xs prefix for
    XSD namespace and no namespace as targetNamespace for a fast
    reuse of common and user sample cases
2019-06-20 15:35:04 +02:00
Davide Brunato 26ab90346b Fix test settings
- Limit memory tests to Python 3.7 (develop version)
  - Add a regression test for issue #64
  - Fix code formatting warnings
2019-06-19 15:34:49 +02:00
Davide Brunato 6d9ce66f40 Add tests for memory usage to test_package.py
- Added memory_profiler to tox.ini deps
2019-06-18 17:26:57 +02:00
Davide Brunato d21ac11dde Fix default values decoding as reported by issue #108
- Default and fixed values are inserted during the decode or
    encode process
  - Update tox.ini to include coverage and flake8 to environments
    and an optional environment to build source and wheel packages
2019-05-31 09:29:41 +02:00
Davide Brunato 3f470927b8 Code cleaning and package dependencies update 2019-05-05 15:13:40 +02:00
Davide Brunato 4dc7714a18 Update documentation and requirements 2019-02-25 14:44:28 +01:00
Davide Brunato ccfaab9479 Fix XML resource defusing
- Add XMLResource.defusing() for checking XML data
  - Now in XMLResource.parse() and fromsource() the SafeXMLParser is
    used only for defusing data
2019-02-25 13:34:52 +01:00
Davide Brunato 9cc61e8788 Rewrite assertions implementation 2019-02-22 22:50:05 +01:00
Davide Brunato 2eabc190fe Replace defusedxml dependency
- The defusedxml seems to be unmaintained and has some problems
    with the ElementTree loading
  - Replaced by a safe XMLParser that forbids entities processing
2019-01-22 17:50:13 +01:00
Davide Brunato fe3078a3c7 Implement a new iter_decode method based on XsdModelVisitor 2018-09-08 11:19:51 +02:00
Davide Brunato 5c1214e950 Improving the iteration of schema elements and groups 2018-07-25 15:57:17 +02:00
Davide Brunato 2ca1bb4fd3 Code cleaning for XsdGroup.iter_decode and iter_decode_children
- Fix for issue #73
  - Removed while cycle in iter_decode
  - Consider that iter_decode_children methods yield only children
    validation errors
  - Added helper function etree_last_child
2018-07-23 13:30:56 +02:00
Davide Brunato e967aa6db8 Use pathlib for checking resource URLs 2018-07-18 11:30:13 +02:00
Davide Brunato 47492aa788 Added TAG_MAP to schemas for lookup functions 2018-06-18 11:18:14 +02:00
Davide Brunato 16327f802a Add positional arguments to tox.ini command 2018-06-01 16:28:08 +02:00
Davide Brunato 449736da37 Fix an issue for builtins encoding and remove py33 from tox.ini
- Added instance_types attribute to XsdAtomicBuiltin: this stores
    the admitted types for an instance, that are used for encode checks.
    If the argument python_type is a tuple the constructor sets
    self.instance_types with the tuple and self.python_type with the
    first item of python_type.
  - Drop support for Python 3.3
2018-05-18 11:28:03 +02:00
Davide Brunato 3d84da310c Update documentation with new features 2018-05-08 06:57:49 +02:00
Davide Brunato a9bc080ae5 Simplifying XSD components hierarchy
- Removed XsdAnnotated
  - XsdAnnotated._parse() now is owned by XsdComponent
  - XsdAnnotation _parse() method skip parent (XsdComponent) method
2018-04-05 09:28:49 +02:00
Davide Brunato e1159ac08d Add test for issue #53 and tox.ini
- The XPath pipe operator is parsed by the 'elementpath' package
  - Configured tox.ini using the test_all.py as command
  - Removed exception class XMLSchemaXPathError
2018-03-29 19:24:05 +02:00