Commit Graph

1521 Commits

Author SHA1 Message Date
Jurko Gospodnetić cca37c0ea2 update HACKING.rst setup.py command notes 2014-04-26 02:14:06 +02:00
Jurko Gospodnetić 624b5b69e2 minor stylistic change 2014-04-26 00:04:04 +02:00
Jurko Gospodnetić 1ce9675221 remove stylistic code formatting inconsistencies 2014-04-26 00:02:44 +02:00
Jurko Gospodnetić 00afa6861a fix default cache folder cleanup error on program shutdown
The related cleanup operation may get called after some of the imported Python
modules have already been unloaded (e.g. os.path), which may then cause the
shutil.rmtree() operation to fail in case the shutil module is imported on
demand. This has been seen when running the project's test suite using the
setup.py test command on Python 2.4.4.
2014-04-25 22:25:36 +02:00
Jurko Gospodnetić e677e4de8e update notes on setting up Python 2.4.x development environments 2014-03-23 22:21:11 +01:00
Jurko Gospodnetić 2878d70754 update todo list 2014-03-23 18:45:06 +01:00
Jurko Gospodnetić 8d3f86e34b remove old & now stale Python 3 compatibility related HACKING note 2014-03-23 18:41:22 +01:00
Jurko Gospodnetić ba39464cec update Python 2.4 compatibility notes - BaseException introduced in 2.5
Code wanting to support Python versions prior to 2.5 needs to re-raise
KeyboardInterrupt & SystemExit exceptions before handling the generic
'Exception' case, unless it really wants to gobble up those special
infrastructural exceptions. Python 2.5 made those exceptions parallel to the
Exception class and so no longer requires them to be handled specially by user
code.
2014-04-27 01:26:40 +02:00
Jurko Gospodnetić 96ae433af8 patch ez_setup_1_4_2.py to handle KeyboardInterrupt & SystemExit correctly
Such exceptions need to be handled separately when catching the generic
Exception class under Python 2.4 or they get gobbled up by the generic exception
handling.
2014-04-27 01:26:40 +02:00
Jurko Gospodnetić ac23dfbbd7 use the latest compatible setuptools version for the current Python version
Now using setuptools 1.4.2 with Python 2.4 & 2.5, and using setuptools 3.3 with
later Python versions. This should help avoid installation issues in different
exotic use cases that were once not being handled by setuptools but have since
been corrected.
2014-03-23 18:39:23 +01:00
Jurko Gospodnetić 32afd327a1 mark the project as compatible with Python 3.4 2014-03-23 18:23:01 +01:00
Jurko Gospodnetić 265a4ec47a update Python interpreter versions used for testing
Now tested using:
  * Python 2.4.3 x86
  * Python 2.4.4 x86
  * Python 2.7.6 x64
  * Python 3.2.5 x64
  * Python 3.3.3 x86
  * Python 3.3.3 x64
  * Python 3.3.5 x64
  * Python 3.4.0 x86
  * Python 3.4.0 x64

Minor stylistic run_all_tests.cmd script changes:
  * Renamed several internal constants.
  * Reordered tests to make those expected to fail more often run sooner.
2014-03-10 12:07:35 +01:00
Jurko Gospodnetić e11d2fa5cc convert tests test_compare_sax._assert_no_output into a generic testing utility
Used for asserting that there was no captured stdout or stderr output.
2014-04-27 01:51:22 +02:00
Jurko Gospodnetić 508f183889 sort pytest test parametrizations the same in every test process
This avoids issues with pytest xdist plugin collecting tests differently in
different test processes when running them using multiple parallal test
processes.

Kudos to Bruno Oliveira (nicoddemus at BitBucket) for researching related pytest
xdist usage problems, discovering & explaining the underlying issue as well as
providing an initial project patch for it.

Introduced a new 'Project implementation note #xxx' concept for documenting
unintuitive code without duplicating embedded explanation comments. Such
implementation notes now documented in the HACKING.rst project document.
2014-03-06 03:45:20 +01:00
Jurko Gospodnetić b4736e9366 clean up test parametrizations in tests.test_xsd_builtins
Independent test parametrizations can be given using separate
@pytest.mark.parametrize test function decorators instead of having to write
extra code to package all their combinations into a single
@pytest.mark.parametrize decorator.
2014-03-06 02:26:52 +01:00
Jurko Gospodnetić 144d147a41 update todo list 2014-03-05 08:26:45 +01:00
Jurko Gospodnetić 1153243edd add CDATA related suds.sax.enc module unit tests
Many of the newly added unit tests marked as 'expected to fail' (xfail) since
the current suds implementation, inherited from the original suds library
project, does not support encoding CDATA XML data sections correctly.
2014-03-05 01:58:23 +01:00
Jurko Gospodnetić da4a47522b add suds SAX encoder profiling script 2014-03-04 21:23:31 +01:00
Jurko Gospodnetić 04d50dc6a5 clean up the testing.external module
Documented the module.
Stylistic comment changes.
2014-03-04 21:22:42 +01:00
Jurko Gospodnetić 68c0b78828 clean up the setup.py module comments - stylistic changes 2014-03-04 21:19:31 +01:00
Jurko Gospodnetić a8159392b6 add suds.sax.enc module unit tests
Initial implementation contributed by Stephen Fuhry (fuhrysteve at BitBucket).
2014-03-04 09:57:39 +01:00
Jurko Gospodnetić 53bf7be23e clean up the suds.sax.enc module
Renamed internal needsEncoding() method to __needs_encoding().
Used double instead of single quotes in string literals.
Line wrapping at 79-columns.
Docstring & comment cleanup.
2014-03-04 09:56:01 +01:00
Jurko Gospodnetić f70ce47c52 update todo list 2014-03-03 18:54:20 +01:00
Jurko Gospodnetić f2f3775433 fix inter-process cache reuse with Python's hash randomization
Updated how suds constructs its cached WSDL & XML identifiers to allow cached
data reuse between different processes with Python's hash randomization feature
enabled.

Previously constructed using the built-in Python hash() function, while now it
gets constructed using md5 hash.

Python's hash randomization (implemented since Python 2.6.8, enabled by default
since Python 3.3) was causing different processes to mangle their cached data
names differently.

Many thanks to Eugene Yakubovich for reporting the issue as well as providing
the initial fix & tests.
2014-03-03 18:50:31 +01:00
Jurko Gospodnetić 0dd3b7a82a add basic suds.reader.Reader unit tests
Currently added tests concentrate on its cache item name mangling.
2014-03-03 18:30:28 +01:00
Jurko Gospodnetić f594e188d4 extract run_test_process() test utility function
run_test_process() test utility function runs a given test script as an external
process and asserts that it returns a 0 exit code and output nothing to its
stdout or stderr output streams. Previously implemented as an internal worker in
the tests.test_cache test module and now extracted as a test utility function
sharable between different test modules.
2014-03-03 18:02:54 +01:00
Jurko Gospodnetić a57361e5c8 remove redundant tempfile module import 2014-03-03 18:00:01 +01:00
Jurko Gospodnetić 7826458612 clean up how tests.test_cache module checks for empty cache folders
Packaged related code in a new _assert_empty_cache_folder() test utility
function allowing asserting for both empty and non-empty cache folders.
Now reports more detailed related test failure messages.
Now correctly detect inaccessible test cache folders instead of silently
treating them as non-empty cache folders.
2014-03-03 17:46:20 +01:00
Jurko Gospodnetić eedb21f0ac update todo list 2014-03-03 14:55:44 +01:00
Jurko Gospodnetić d25ca4989c refactor the CompareSAX test utility implementation
Extract into a separate tests.compare_sax test utility module.
Extract its unit tests into a separate tests.test_compare_sax unit test module.
Make sure the tests.compare_sax module content gets processed by pytest when
performing its asserting rewriting even if the module does not observe the usual
test module naming convention (i.e. it does not begin with 'test_').

Removed the no longer used tests.test_utility test utility module.

As a slight related cleanup, pytest configured so it no longer recognizes
Python modules with name suffix '_test.py' as test modules. Such names are not
used in this project so removing their lookup should speed up pytest's test
collection slightly.
2014-03-03 14:55:37 +01:00
Jurko Gospodnetić 20e19aad12 add unit tests for the CompareSAX test utility
** About running the new tests with disabled Python assertions **

Since the CompareSAX uses pytest assertions, it can not be tested when Python
assertions have been disabled in that module, but pytest assertion rewriting
saves us from this if it is enabled. This effectively means that the new tests
can not be run with disabled Python assertions without pytest's assertion
rewriting being enabled.

Since pytest assertion rewriting has not been implemented for Python versions
prior to 2.6, the new tests can not be run with disabled Python assertions using
such Python versions at all.
2014-03-03 12:01:45 +01:00
Jurko Gospodnetić d437ee4aef report more detailed CompareSAX mismatch context information
CompareSAX now reports in more detail where it detected a mismatch in its given
XML documents. The context information gets output to the process's standard
error stream.

In the future, it would be nice if we could somehow integrate this context
information inside standard pytest test failure reporting (both for assertion
failures & unhandled exceptions).
2014-03-03 10:39:08 +01:00
Jurko Gospodnetić a94649e70a refactor CompareSAX XML element namespace & text comparison
Now uses an officially suggested way of detecting an empty string by checking
the object's bool value.
2014-03-03 10:11:15 +01:00
Jurko Gospodnetić fa38872aae improve CompareSAX default/empty namespace comparison
CompareSAX now treats empty string & None namespaces as matching. This has been
done because the following three XML elements all have the same namespace:
  <a/>
  <a xmlns=""/>
  <ns:a xmlns:ns=""/>
however the suds SAX document model represents that namespace sometimes as an
empty string and sometimes as None.

Added embedded TODO comments to remove this equivalence both here and when
comparing an XML element's textual content as soon as the underlying suds SAX
document model gets updated to represent empty/missing text/namespaces
consistently.
2014-03-03 10:09:45 +01:00
Jurko Gospodnetić 4845476f60 improve CompareSAX comparison failure reports
Previous implementation simply reported that there is a mismatch, without
specifying exactly the type or the location of the mismatch. Now CompareSAX uses
assertions instead of return values to report back failed comparisons. Since the
code is localized to a pytest based test suite, this makes all such detected
mismatches be nicely reported by pytest, including a precise stack trace. The
stack trace can be used to locate the exact mismatch in the debugger.
2014-03-03 10:00:15 +01:00
Jurko Gospodnetić 1d79bb558c refactor CompareSAX.element2element() test utility
Made more readable.
Element textual content comparison code extracted to a separate private
CompareSAX.__compare_element_text() utility method.
2014-03-01 09:36:05 +01:00
Jurko Gospodnetić 94cfa6fdc7 add support for comparing multi-element SAX XML documents
CompareSAX.document2document() used to be artificially restricted to comparing
only SAX XML documents consisting of only a single child element. Now it knows
how to compare any two SAX XML documents, comparing its child elements the same
way an element's child elements are compared.
2014-03-01 07:50:58 +01:00
Jurko Gospodnetić 339eaaa984 update todo list 2014-02-28 15:32:16 +01:00
Jurko Gospodnetić 0cc63521c6 extract SAX XML document comparison test utilities into a separate module
SAX XML document comparison test utility functions moved to the new module as
class methods under a new CompareSAX class:
  compare_xml() --> CompareSAX.document2document()
  compare_xml_element() --> CompareSAX.element2element()
  compare_xml_string_to_string() --> CompareSAX.data2data()
  compare_xml_to_string() --> CompareSAX.document2data()

Better documented the implemented SAX XML document comparison functionality.

Affected comparisons now assert their expected input data structure instead of
simply returning False in case differently structured input data is detected.

Extracted duplicate XML data SAX parsing code into a new private
CompareSAX.__parse_data() worker method.
2014-02-28 14:34:39 +01:00
Jurko Gospodnetić 3291847b40 clean up the suds.sax.element module
Minor function code refactoring.
Always passing a tuple as a %-string formatting parameter.
Used double instead of single quotes in string literals.
Docstring & comment cleanup.
2014-02-28 02:29:51 +01:00
Jurko Gospodnetić 5c5d922bdb fix a suds.sax.element.Element exception message
This is the exception message constructed when attempting to construct a
suds.sax.element.Element with a non-Element parent. It seems like someone forgot
to apply % string formatting in its construction.
2014-02-28 02:20:19 +01:00
Jurko Gospodnetić cdf67017d9 remove whitespace before test XML data no-content tag closing '/>' markers 2014-02-28 02:11:30 +01:00
Jurko Gospodnetić 075befd43f clean up test data in the tests.test_suds test module
Standardized XML formatting.
Several test input XML documents made shorter & more easily readable by better
namespace usage.
2014-02-28 02:01:28 +01:00
Jurko Gospodnetić d17d389477 clean up the suds.xsd.schema module
Reordered module imports alphabetically.
Always passing a tuple as a %-string formatting parameter.
Used double instead of single quotes in string literals.
Docstring & comment cleanup.
2014-02-28 01:51:41 +01:00
Jurko Gospodnetić b1a4c42c61 inline local variable in Printer.unwrap() - minor code cleanup 2014-02-28 01:07:57 +01:00
Jurko Gospodnetić bdf60de80e clean up the suds.sax.parser module
Minor code refactoring.
Used double instead of single quotes in string literals.
Docstring & comment cleanup.
2014-02-28 01:06:22 +01:00
Jurko Gospodnetić e5cf6ba74b correct try:/except: blocks eating up internal Python exceptions
All such block replaced with blocks catching Exception subclasses only so they
no longer eat up internal Python exceptions like SystemExit or
KeyboardInterrupt.
2014-02-28 00:51:15 +01: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ć d53f9f33e2 clean up the tests.test_request_construction module
Shortened expected constructed SOAP request data.
Extracted duplicate test data into named variables.
Renamed internal Python names to not use the camelCase naming convention and
use underscores instead.
Updated tests using the shared WSDL schema construction to explicitly name the
included operation if they call it instead of relying on the operation being
called 'f' by default.
Always passing a tuple as a %-string formatting parameter.
Reimplemented named lambda's as regular local functions.
2014-02-26 07:37:53 +01:00
Jurko Gospodnetić 830d6140f5 add a rudimentary 'soapheaders' option usage test 2014-02-26 06:17:46 +01:00