Added a 'notes/' project folder. Described the new folder both in a readme.txt
file contained in that folder and in the project's central HACKING.rst
documentation. The folder and its *.rst/*.txt content is included in the
project's source distribution, but is not included in project builds &
installations.
Updated project release notes.
Updated todo list.
Extra arguments used when making a web service operation call are now reported
similar to how this is done for regular Python functions. The extra argument
error reporting may be disabled using the new 'extraArgumentErrors' suds option.
Basic idea and the initial implementation for this feature contributed by
Bouke Haarsma.
Additional changes made as a part of working on the new functionality:
Binding agnostic part of suds's web service operation invocation argument
parsing extracted into a separate module. The code has been extracted mostly
from the 'Document' binding implementation, and has not yet been applied to the
'RPC' binding but we are getting there. Once this is done, 'RPC' binding support
should match the one already implemented for the 'Document' binding, e.g.
support for automatically unwrapping simple input parameter structures &
reporting extra parameters.
Test updates:
* Split up some web service operation invocation request construction tests
into:
- parameter definition tests
- argument parsing tests
- binding specific request construction tests.
* Many new tests added & existing ones extended.
* Several redundant tests removed.
* Better test support when running with disabled assertion optimizations
enabled.
* Implemented an indirect_parametrize pytest plugin to help with implementing
some more complex test case parametrizations without unnecessary test data
duplication.
Several of the new or updated tests have been marked as 'expected to fail' as
they demonstrate known issues with suds. None of the issues have been newly
introduced by the new feature, but have only been explicitly uncovered while
working on it.
Removed unnecessary imports in 'tests/__init__.py'.
No more code from the original suds library implementation left in
'tests/__init__.py' so updated the module's author information.
This fixes all xpass test results reported when running our test suite with the
'disable assertions' optimization enabled ('-O' Python command-line option)
using Python interpreter versions 2.6 and above.
Testing assertions located outside a pytest test module (e.g. inside some
project specific shared testing utility function) are ignored when running the
tests using Python's disable assertions optimization while pytest takes care to
preserve all assertions located inside its test modules.
Added tests prepared based on test input used in previously removed redundant
extra parameter tests.
Several of the new tests have been marked as 'expected to fail' due to known
suds library implementation issues:
- empty choice member items not supported
- unsupported minOccurs/maxOccurs attributes on all/choice/sequence order
indicators,
- buggy non-optional choice parameter handling
The new pytest plugin allows a clean & well integrated way of defining test
parametrizations with data constructed using a function instead of having to be
explicitly passed to a pytest.mark.parametrize() call.
An alternative would be to use a function constructing pytest.mark.parametrize()
arguments but the current solution causes less clutter when used and seems more
intuitive to someone used to using pytest.mark.parametrize().
Removed tests have been covered by related argument parsing and input parameter
definition structure tests.
All remaining extra parameter tests are the ones using input WSDL schemas not
directly representable by suds library's current internal parameter definition
structure have and been moved to the test_input_parameters.py test module. Most
of them were already marked as 'expected to fail' and all of them now serve only
as reminders to fix some part of the suds library implementation.
Several tests in the test_input_parameters.py module expect their test web
service operation to be called using wrapped or unwrapped input parameters.
Those tests have now been updated to explicitly check their expectations.
Prepared a utility function for constructing preparing expected parameter
definition structures based on given parameter type XSD schema. This will help
avoid code duplication when cloning existing test cases using new input data.
Made the _unwrappable_wsdl() helper function more generic so it can be used for
constructing WSDL schemas with different input parameter type definition XSD
schemas.
Tests in this module should make related tests in test_suds.py &
test_request_construction.py test modules redundant, while at the same time
being concentrated on more specific part of the suds library functionality.
pytest test framework's pytest.raised() assertion function returns the a
wrapper around the caught exception object. New code uses this to check the
caught exception instead of hand crafted try:/catch: blocks. Special care is
taken to explicitly delete any local exception references so they would not
cause uncollectable reference cycles.
Inlined the internal _expect_error() worker in the test_request_construction.py
test module and a similar _expect_error_worker() worker in the
test_argument_parser.py module.
This makes the rules for using the argument parsing implementation much
simpler and reduces a chance of invalid usage errors. User code now just calls
a single function instead of having to first create a parser object and then
calling several of its methods in a precisely defined order.
The original ArgParser function object is still used but has now been renamed
to _ArgParser and is now considered an internal implementation detail for the
argument parsing implementation.
The rules for deciding what parameter definitions are acceptable have been
relaxed a bit:
* User no longer needs to explicitly specify whether the web service
operation is being invoked using suds library's automatic input parameter
unwrapping. This is now determined internally based on the passed input
parameter ancestry information.
* As far as argument parsing is concerned, it is now ok to call a web service
operation using multiple parameters, some of which are automatically
unwrapped, and some are not. This feature is not actually used in suds
code, but the restriction here was pretty much an artificial one and only
added unnecessary code.
Updated many related docstring comments.
Updated related unit tests.
Added based on existing document binding specific extra parameter handling
tests in test_request_construction.py plus some extra scenarions invented as
well.
The added test is run for only some of the possibly interesting scenarios. At
the moment, it tests only operations taking at most one input parameter, but
has been prepared with as a general enough test template so it can be run in
more complex scenarios as well.
Disabling extra parameter value errors should also disable errors reporting
multiple alternative values being defined for different elements inside the
same choice parameter group. This fixes potential backward compatibility issues
in case the new 'extra parameter value' errors are disabled.