Commit Graph

20 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 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 62c08282c3 Update XMLSchemaTestCase
- cls.abspath() replaced by cls.casepath()
2019-02-02 11:23:37 +01:00
Davide Brunato 5f10fe67a7 Code cleaning of test scripts
- Removed old code of xmlschema imports
  - Test header enriched with Python version and platform
2019-01-31 22:09:18 +01:00
Davide Brunato 9d6b88baae Change copyright years info 2019-01-20 16:56:10 +01: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
Davide Brunato fa796d2dcf Complete xpath module substitution, improve testing
- With elementpath-1.0.4 pass all tests
  - Check version alignment with test_package.py
2018-03-27 19:47:56 +02:00
Davide Brunato 95928bf5c2 Stop on developing XPath into xmlschema package
- The XPath code will be splitted to another package for an
    independent support and usage;
  - The new lib for XPath will be added as dependency.
2018-02-14 07:09:52 +01:00
Davide Brunato 3c13777602 Fixing the name format of elements and attributes
- Local elements and attributes with form == 'unqualified' now
    have an unqualified name.
  - Attribute groups include both qualified and unqualified lookups
    for unqualified attributes.
2018-02-04 08:42:17 +01:00
Davide Brunato ef0ec177f1 Divide XPath code from XSD constraints code
Module to constraints.py:

  - XPathSelector renamed to XsdSelector
  - Created a XsdFieldSelector subclass for parsing xs:field definitions
  - Added an XsdSelectorXPathParser created by xpath builder function

Module xpath.py:

  - Created 2 full lists for XPath1 and XPath2 (to complete)
  - Created the XPathSelector class
2018-01-27 00:01:11 +01:00
Davide Brunato d1139433fc Revise tests and add instance nillability overrides (xsi:nil attribute)
Test cases refactoring:
  - now the base dir is tests/cases/
  - test cases grouped into examples/, features/ and issues/ subdirs
  - added --extra argument to test scripts that use extra cases
2018-01-15 06:40:13 +01:00
Davide Brunato d56208106b Update test scripts
- add setUpClass() method to test classes
  - XMLSchemaTestCase class removed
  - common test definitions are now in xmlschema/tests/__init__.py
  - xmlschema/tests/_test_common.py deleted
2018-01-09 10:52:39 +01:00
Davide Brunato 43d0c77eee Fixed bug #34, updated copyright information. 2018-01-08 09:15:09 +01:00
Davide Brunato 161553b20f Tests improving and bugfix:
- Rewritten imports and use a common factory function for tests
  - Fixed an unclosed urlopen into function get_xml_root of
    xmlschema/resource.py module
2017-11-18 22:17:20 +01:00
Davide Brunato f788c0a00e Improving tests and bugfix of issue #22. 2017-11-17 14:41:44 +01:00
Davide Brunato 6e992aab09 Fixed some bugs, code cleaning:
* Fixes for bugs #14, #15, #16
  * Removed unused module xmlschema/etree.py
  * Added tests for URLs processing (test URL normalization)
  * Updated licence information (added "-2017")
2017-09-14 13:31:02 +02:00
Davide Brunato 17b291783e Added a module for identity constraints:
* new file: xmlschema/components/constraints.py
  * parsed xs:unique, xs:key and xs:keyref and subcomponents
  * added '|' as reference delimiter in xpath.py tokenizer
  * improved XPathParser to check operator: the base class
    admits all operators, subclasses can restricts overriding
    NOT_ALLOWED_OPERATORS class attribute.
2017-09-12 18:16:41 +02:00
Davide Brunato 4c3add76e6 First working version for encode data to XML:
* Added ElementData namedtuple to represent Element
    decoded or encoded data.
  * Fixed a bug in qname.reference_to_qname() that mapped
    every local name to target namespace.
2017-06-15 07:59:00 +02:00
Davide Brunato e6b3383b0d Switch to version 0.9.7 with some improvements:
* Documentation extended
  * Docuemtation examples now are tested with doctest
  * Improved tests for XPath, validation and decoding
  * The collection.xsd example schema has been extended
  * Removed the exception XMLSchemaBaseValidatorError
  * Now XMLSchemaValidationError is the parent class of
    decode/encode exceptions
2017-05-21 11:27:00 +02:00
Davide Brunato d090df9fa3 Improved XPath parser and testing:
* Added test files for decoder (examples/decoder/*);
  * Added a variant of test schema vehicles.xsd (examples/vehicles/vehicles2.xsd);
  * Added XPath filter predicates;
  * Fixed empty dict decoding to None (issue #4).
2017-05-15 08:06:32 +02:00