Skip to content

Commit

Permalink
Ensure get_soap_client() caches with verify
Browse files Browse the repository at this point in the history
This fixes the get_soap_client() function to cache SOAP clients taking
the verify argument into account.

Fixes 3fcebb2
  • Loading branch information
arthurdejong committed Sep 15, 2024
1 parent 6c2873c commit 0ceb2b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stdnum/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def get_soap_client(wsdlurl, timeout=30, verify=True): # pragma: no cover (not
# this function isn't automatically tested because the functions using
# it are not automatically tested and it requires network access for proper
# testing
if (wsdlurl, timeout) not in _soap_clients:
if (wsdlurl, timeout, verify) not in _soap_clients:
for function in (_get_zeep_soap_client, _get_suds_soap_client, _get_pysimplesoap_soap_client):
try:
client = function(wsdlurl, timeout, verify)
Expand All @@ -321,5 +321,5 @@ def get_soap_client(wsdlurl, timeout=30, verify=True): # pragma: no cover (not
pass
else:
raise ImportError('No SOAP library (such as zeep) found')
_soap_clients[(wsdlurl, timeout)] = client
return _soap_clients[(wsdlurl, timeout)]
_soap_clients[(wsdlurl, timeout, verify)] = client
return _soap_clients[(wsdlurl, timeout, verify)]

0 comments on commit 0ceb2b9

Please sign in to comment.