Suds now correctly handles twisted use-cases as seen in some M$ web services,
and whose one possible structure has been illustrated by the
test_recursive_WSDL_import() test in the test_client.py test module.
Note that this has nothing to do with recursive XSD schema imports which still
have known issues.
Updated todo list.
- less duplication
- test specific test data now contained in those tests
- test data can now be constructed with custom XSD target namespace
- tests depending on imported & importing WSDL target namespaces now specify
them explicitly
Reduced test data duplication and made the data more parametrizable so we may
use the same data for testing more WSDL import variations.
Moved some more parts of the WSDL import test data into the imported WSDL
schema.
When one WSDL imports another, this does not mean that the components from the
imported WSDL become part of the importing WSDL, but only means that importing
WSDL's components may now reference components from the imported WSDL.
The fact that suds currently imports actual components into the importing WSDL
is in fact a possible bug (unless it is just a part of some internal
implementation detail with no publicly visible side-effects, but even then such
a kludge should be made clearer in code).
The test suite is no longer installed together with the project and can now be
run from the project's source distribution. This resolves the issue of the suds
test suite confusing users by getting installed as a top level tests package in
their Python environment.
Project to be tested now need to be explicitly installed prior to running its
tests using pytest, except in case of Python 2 tests being run from the top
level project folder. This requires the user to install the project (suggested
way is to install it in editable mode using 'pip install -e') but also allows
him to run the tests on other non-sandbox project versions, e.g. an externally
installed version.
Project testing now requires the six Python 2/3 compatibility support package
(installed automatically, together with other test requirements).
Test support code now moved to a separate testutils package located under the
tests folder.
Updated project README.rst & HACKING.rst docs.
Minor stylistic changes.
Extracted duplicate test data into named variables.
Renamed test data XML namespaces not used explicitly to avoid accidental
collisions with those used explicitly.
Tested exception handling for exceptions raised from both transport.open() &
transport.send() operations but with the latter testing being only rudimentary.
The registered transport needs to be asked to transfer the constructed request
and return a corresponding reply. The data e presented back to the calling user
code needs to come from that same reply.
As a side-effect MockTransport.mock_data structure now changed a bit, making its
item's second member a list of all input parameters for the operation related to
that specific item, instead of just the operation's URL.
This makes mock log data members in MockCache, MockDocumentStore & MockTransport
use the same name and thus makes those mock classes more intuitive to use.
MockTransport.send() operation had some bugs in it:
- misnamed mock input data member in MockTransport.__init__()
- return value was constructed as if for MockTransport.open()
The operation is not used anywhere yet, but has not been removed since it will
soon be used in a new test currently under being developed (that is how the
bugs got detected in the first place).
Reusing an already cached WSDL object must not cause suds cliend to attemt to
fetch any of the external documents referenced from that WSDL object, either
from the client's cache, document store or using its registered transport.
The test_fetching_WSDL_from_cache_avoids_store_avoids_transport() test made to
run using both of suds caching policies:
0 - caching downloaded XML documents
1 - caching final constructed WSDL documents
and renamed to test_using_cached_WSDL_avoids_store_avoids_transport().
If an external document is not cached or found in the client's registered
document store, it should be fetched using the registered transport. This holds
for directly used & indirectly imported WSDL schemas, as well as imported or
included XSD schemas.
Related existing tests refactored a bit to reduce code duplication:
* extracted shared test data
* test_WSDL_not_found_in_cache_or_store_should_be_transported() renamed to
test_WSDL_transport() and moved into the TestTransportUsage test class
This functionality was already being tested. Renamed & better commented the
following tests to explicitly note this:
test_importing_WSDL_from_cache_should_avoid_store_and_transport()
--> test_importing_WSDL_from_cache_avoids_store_avoids_transport()
test_using_cached_XSD_schema_should_avoid_store_and_transport()
--> test_using_cached_XSD_schema_avoids_store_avoids_transport()
test_fetching_WSDL_from_store_should_avoid_transport() test is redundant since
the test_fetching_WSDL_from_cache_should_avoid_store_and_transport() test
already covers this same functionality. Renamed
test_fetching_WSDL_from_cache_should_avoid_store_and_transport() to
test_fetching_WSDL_from_cache_avoids_store_avoids_transport().
Updated the test_using_cached_XSD_schema_should_avoid_store_and_transport() test
to be able to run with and without first removing the main WSDL schema from the
cache before checking that the cached XSD schema gets used.
Minor stylistic changes.
test_using_cached_XSD_schema_should_avoid_store_and_transport() test makes sense
only when using cachingpolicy == 0. The test created two suds.client.Client
instances but explicitly set the cachingpolicy option to 0 only on the first.
This was inconsistent but worked fine since 0 is the default cachingpolicy
option value.
The test has been integrated into the existing
test_import_XSD_from_cache_should_avoid_store_and_transport() test and the test
renames to test_using_cached_XSD_schema_should_avoid_store_and_transport().
Makes sure imported XSD schemas can be read from the cache and that in that case
the client does not attempt to fetch the same information from its document
store or using its registered transport.
MockCache objects now track the exact parameters passed to all the operations
invoked on them. Updated related tests to assert that those parameters have
expected values.
The original test removed as it was basically doing the same thing as the
test_wsdl_not_found_in_cache_or_store_should_be_transported() test in the
test_client.py test module. The latter extended to run using multiple URLs.
The only thing the original test was doing differently was that it was using
the HttpTransport.urlopener infrastructure. This has no been replaced by two
new HttpTransport tests explicitly testing its urlopener usage.
runUsingPyTest() utility test function renamed to run_using_pytest().
Many local variables/attributes renamed to use underscores instead of camelCase.
test_timezone.py test module converted to use the standard Python coding
specification comment instead of the UTF-8 BOM.
Minor stylistic changes.
The new module is planned to contain unit tests related to suds.client.Client's
external component usage for different types of external components such as
cache, store or transport.