Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_bind():
client_obj = client.Client("tests/wsdl_files/soap.wsdl")
service = client_obj.bind()
assert service
def test_load_wsdl_with_file_prefix():
cwd = os.path.dirname(__file__)
client.Client("file://" + os.path.join(cwd, "wsdl_files/soap.wsdl"))
def test_open_from_file_object():
with open("tests/wsdl_files/soap_transport_err.wsdl", "rb") as fh:
client_obj = client.Client(fh)
service = client_obj.bind()
assert service
def test_create_service():
client_obj = client.Client("tests/wsdl_files/soap.wsdl")
service = client_obj.create_service(
"{http://example.com/stockquote.wsdl}StockQuoteBinding",
"http://test.python-zeep.org/x",
)
response = """
120.123
def test_force_https():
with open("tests/wsdl_files/soap.wsdl") as fh:
response = fh.read()
with requests_mock.mock() as m:
url = "https://tests.python-zeep.org/wsdl"
m.get(url, text=response, status_code=200)
client_obj = client.Client(url)
binding_options = client_obj.service._binding_options
assert binding_options["address"].startswith("https")
expected_url = "https://example.com/stockquote"
assert binding_options["address"] == expected_url
def test_integration():
client_obj = client.Client(
"tests/wsdl_files/soap.wsdl", wsse=UsernameToken("username", "password")
)
response = """
120.123
""".strip()
def _initiate_client():
return Client(RCH_WSDL_URL)
cache = SqliteCache() if args.cache else None
session = requests.Session()
if args.no_verify:
session.verify = False
result = urlparse(args.wsdl_file)
if result.username or result.password:
session.auth = (result.username, result.password)
transport = Transport(cache=cache, session=session)
st = time.time()
settings = Settings(strict=not args.no_strict)
client = Client(args.wsdl_file, transport=transport, settings=settings)
logger.debug("Loading WSDL took %sms", (time.time() - st) * 1000)
if args.profile:
profile.disable()
profile.dump_stats(args.profile)
client.wsdl.dump()
def __init__(self, api_name: str, api_secret: str, account_email: str):
self.api_name = api_name
self.api_secret = api_secret
self.account_email = account_email
self.client = Client(self.wsdl)