Commit Graph

41 Commits

Author SHA1 Message Date
Jurko Gospodnetić 9ae9646e3b add WSDL self import test 2015-06-30 00:11:33 +02:00
Jurko Gospodnetić a78141ada6 fix an additional broken recursive WSDL import scenario
- added related test
- fixed the issue & commented the fix
- updated related already existing comment in the original WSDL import fix
2015-06-29 23:39:51 +02:00
Jurko Gospodnetić 01524e2cfe fix comment typo 2015-06-29 21:48:36 +02:00
Jurko Gospodnetić 412be82578 refactor WSDL import related tests
All such tests were incorrectly left grouped under a class related to a more
specific use-case, and the class's description did not match its purpose.
2015-06-29 21:39:55 +02:00
Jurko Gospodnetić ab2b7a4c5c fix broken recursive WSDL imports
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.
2015-06-29 21:31:38 +02:00
Jurko Gospodnetić 122540ec8b test resolving WSDL entity references to entities defined later in XML 2015-06-29 00:14:26 +02:00
Jurko Gospodnetić 8eeb515872 add an xfail test demonstrating a bug with recursive WSDL imports 2015-06-28 22:33:49 +02:00
Jurko Gospodnetić 0a36ee2b21 replace suds with six compatibility tools in test_client.py 2015-06-28 22:32:32 +02:00
Jurko Gospodnetić da40a0153a test referencing imported WSDL entities with same base & imported tns
Updated todo list.
2015-06-28 22:02:06 +02:00
Jurko Gospodnetić 8060225bb3 tidy up WSDL import test data & its usage
- 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
2015-06-28 21:57:07 +02:00
Jurko Gospodnetić 8905c666d2 add tests showing how imported WSDL entities are referenced 2015-06-28 21:35:46 +02:00
Jurko Gospodnetić a7bdabf3a4 clean up WSDL importing test data
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.
2015-06-28 21:11:34 +02:00
Jurko Gospodnetić e7dd8e6e51 remove invalid test_WSDL_import() test
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).
2015-06-28 19:49:02 +02:00
Jurko Gospodnetić 1618ae351f reorganize tests - run on installed suds version + do not require py2to3
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.
2014-05-17 14:08:18 +02:00
Jurko Gospodnetić 9f1d3b6ce4 reduce tests.test_client module test data duplication
Extracted duplicate test data into named variables.
Renamed test data XML namespaces not used explicitly to avoid accidental
collisions with those used explicitly.
2014-02-26 08:08:43 +01:00
Jurko Gospodnetić 64d12f6208 test client transport usage exception handling
Tested exception handling for exceptions raised from both transport.open() &
transport.send() operations but with the latter testing being only rudimentary.
2014-02-21 14:22:13 +01:00
Jurko Gospodnetić b5cbe3a61d make test_client.py MockTransport support raising send()/open() exceptions 2014-02-20 21:29:14 +01:00
Jurko Gospodnetić fe4cc2b202 fix suds.client.Client tests using the default cache by accident
Such tests may be broken by other tests using the same default cache since there
is only one default cache instance per process.
2014-02-20 21:27:54 +01:00
Jurko Gospodnetić 918f7f0802 clean up test code line wrapping - stylistic change 2014-02-20 21:24:06 +01:00
Jurko Gospodnetić a71365709b test suds client's transport usage on WS operation calls
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.
2014-02-20 14:25:49 +01:00
Jurko Gospodnetić a36817fcfc make MockTransport log the exact send() operation input message
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.
2014-02-20 14:21:30 +01:00
Jurko Gospodnetić 9863ff931e clean up test code - rename mock_operation_log members to mock_log
This makes mock log data members in MockCache, MockDocumentStore & MockTransport
use the same name and thus makes those mock classes more intuitive to use.
2014-02-20 14:16:58 +01:00
Jurko Gospodnetić cdcf0c79d1 fix MockTransport.send() operation in tests/test_client.py
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).
2014-02-20 14:13:09 +01:00
Jurko Gospodnetić f6632c8aa2 mark internal test data assertions as 'bad test data' 2014-02-20 14:07:21 +01:00
Jurko Gospodnetić 9447ec85d8 test that using a cached WSDL object avoids external document fetching
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.
2014-02-19 19:54:19 +01:00
Jurko Gospodnetić 72868c1bf3 test cached WSDL usage using both caching policies
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().
2014-02-19 18:48:57 +01:00
Jurko Gospodnetić a1759f1593 add tests for client fetching documents using a registered 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
2014-02-19 15:43:30 +01:00
Jurko Gospodnetić e5fbde2c62 test external WSDL/XSD from store --> not fetched using transport
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()
2014-02-19 14:58:18 +01:00
Jurko Gospodnetić 1b3abeca78 remove a redundant test
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().
2014-02-19 14:44:31 +01:00
Jurko Gospodnetić 0edbc19ea7 test using a cached XSD schema with an already cached main WSDL
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.
2014-02-19 14:31:21 +01:00
Jurko Gospodnetić 8edb612a98 fix stylistic inconsistency when testing cached XSD schema usage
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.
2014-02-19 13:08:12 +01:00
Jurko Gospodnetić a279aea9fb add a test_importing_WSDL_from_cache_should_avoid_store_and_transport() test 2014-02-19 12:06:36 +01:00
Jurko Gospodnetić fb2b2e948e add a failing test_WSDL_import() test
Demonstrates a problem with external WSDL schema's <wsdl:service/> tag
information not getting imported correctly.
2014-02-19 12:05:51 +01:00
Jurko Gospodnetić cf2d3b1be9 add a test for including a cached external XSD schema
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().
2014-02-18 20:13:52 +01:00
Jurko Gospodnetić b27a4cfafa rename test function - stylistic 'wsdl' --> 'WSDL' change
Renamed test_fetching_wsdl_from_cache_should_avoid_store_and_transport() to
test_fetching_wsdl_from_cache_should_avoid_store_and_transport().
2014-02-18 13:44:25 +01:00
Jurko Gospodnetić fd9f209c2b add test_import_XSD_from_cache_should_avoid_store_and_transport() unit test
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.
2014-02-18 13:45:28 +01:00
Jurko Gospodnetić 6cb2ec2c65 improve suds.client unit tests - check MockCache operation parameters
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.
2014-02-18 13:43:38 +01:00
Jurko Gospodnetić 167a85a8aa refactor test_http_request_URL() HttpTransport test
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.
2014-02-10 11:14:02 +01:00
Jurko Gospodnetić 7317451020 clean up test code
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.
2014-02-10 09:32:12 +01:00
Jurko Gospodnetić 63dede6468 added more detailed suds.client.Client cache/store/transport usage tests
Made suds.DocumentStore & suds.transport.Transport be new-style classes under
Python 2.

Minor stylistic test code changes.
2014-02-10 01:31:02 +01:00
Jurko Gospodnetić e9813e3feb convert test_client_cache.py test module to test_client.py
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.
2014-02-09 14:02:55 +01:00