Make SOAP services testable from pytest — point at a WSDL, get callable Python.
Project description
soaptest
Make SOAP services testable from pytest. Point it at a WSDL, get callable Python.
30-second example
pip install soaptest
from soaptest import Client
client = Client.from_wsdl(
"http://www.dataaccess.com/webservicesserver/NumberConversion.wso?WSDL"
)
# Discover what's available
print(client.describe())
# NumberConversionSoap @ http://www.dataaccess.com/webservicesserver/NumberConversion.wso
# NumberToWords(ubiNum: nonNegativeInteger) -> string
# NumberToDollars(dNum: decimal) -> string
# Call any operation by name
result = client.NumberToWords(ubiNum=42)
print(result) # "forty two "
Why
SOAP testing today means SoapUI (a 200 MB GUI) or hand-rolling requests with raw XML.
Neither fits naturally into a pytest suite.
soaptest is a thin Pythonic layer on top of zeep.
It gives you WSDL discovery (describe()) and operation dispatch (client.OpName(**kwargs))
with zero boilerplate. You write plain pytest test functions; soaptest handles the SOAP.
What it does not do yet: record/replay of responses, fault translation into typed Python exceptions, type stubs for operations, or a pytest fixture plugin. Those are on the Roadmap. v0.1 is intentionally minimal — get the basics right first.
Installation
pip install soaptest
Python 3.9+ is required. zeep, lxml, and httpx are installed automatically.
Usage
Discover operations
from soaptest import Client
client = Client.from_wsdl("https://yourservice.example.com/service?WSDL")
print(client.describe()) # pretty-printed operation list
ops = client.operations # list of Operation named-tuples
Each Operation has: name, input_signature, output_signature, service, port, port_url.
Call an operation
result = client.SomeOperation(param1="value", param2=123)
__getattr__ dispatches to the underlying zeep service. The return value is whatever
zeep returns (usually a zeep.objects.* object or a plain Python scalar). No conversion
in v0.1 — that's a future feature.
Unknown operation names raise AttributeError, so hasattr(client, "Op") works.
CLI
soaptest http://www.dataaccess.com/webservicesserver/NumberConversion.wso?WSDL
Prints the operation catalog to stdout and exits.
In pytest
import pytest
from soaptest import Client
WSDL = "https://yourservice.example.com/service?WSDL"
@pytest.fixture(scope="session")
def soap_client():
return Client.from_wsdl(WSDL)
def test_something(soap_client):
result = soap_client.SomeOperation(param="value")
assert result.status == "OK"
Roadmap
v0.1 ships the discovery layer only. Planned for later releases:
- Fault translation — map SOAP faults to a typed
SoapFaultPython exception - pytest fixture plugin —
@pytest.fixturehelpers and a--wsdlCLI option - Type-stub generation — emit
.pyistubs so IDEs can autocomplete operations - Record/replay — record live responses to YAML cassettes; replay offline
Contributing
File a bug or feature request in the issue tracker. Pull requests are welcome once an issue is open. For major changes, open an issue first to discuss scope.
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file soaptest-0.1.2.tar.gz.
File metadata
- Download URL: soaptest-0.1.2.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69f4d10da42efa95751a7d7720c9933bb5903f1301d3fc9c7b03788498adf019
|
|
| MD5 |
e0a5d83143815717d3b52eb492630787
|
|
| BLAKE2b-256 |
d200a311a1936494eeda8feebb522d7155d538e32d41d7c252a8746140bb3e92
|
Provenance
The following attestation bundles were made for soaptest-0.1.2.tar.gz:
Publisher:
release.yml on jaey8den/soaptest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
soaptest-0.1.2.tar.gz -
Subject digest:
69f4d10da42efa95751a7d7720c9933bb5903f1301d3fc9c7b03788498adf019 - Sigstore transparency entry: 1615414627
- Sigstore integration time:
-
Permalink:
jaey8den/soaptest@5e92a1980b91fd14ef4b3eca32b701a1490f68da -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jaey8den
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5e92a1980b91fd14ef4b3eca32b701a1490f68da -
Trigger Event:
push
-
Statement type:
File details
Details for the file soaptest-0.1.2-py3-none-any.whl.
File metadata
- Download URL: soaptest-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0bc4b7dfde1e7565ac1eed5076cb2f80ea20223a742603654bf465fdfe6852f
|
|
| MD5 |
ed06369eb9cd297f26a1782ef72104fa
|
|
| BLAKE2b-256 |
781d22dd7ff331e3f63228dbb46f18d225bad4bfe56ef893cd85499180f14ecb
|
Provenance
The following attestation bundles were made for soaptest-0.1.2-py3-none-any.whl:
Publisher:
release.yml on jaey8den/soaptest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
soaptest-0.1.2-py3-none-any.whl -
Subject digest:
b0bc4b7dfde1e7565ac1eed5076cb2f80ea20223a742603654bf465fdfe6852f - Sigstore transparency entry: 1615414659
- Sigstore integration time:
-
Permalink:
jaey8den/soaptest@5e92a1980b91fd14ef4b3eca32b701a1490f68da -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jaey8den
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5e92a1980b91fd14ef4b3eca32b701a1490f68da -
Trigger Event:
push
-
Statement type: