def test_urlreplacement_signature(abstract_message_input): wsdl = stub(schema=stub(_prefix_map={})) operation = stub(location='my-action/(arg1)/(arg2)/', name='foo') msg = messages.UrlReplacement( wsdl=wsdl, name=None, operation=operation) msg._info = { 'body': {'namespace': 'http://test.python-zeep.org/tests/rpc'}, 'header': None, 'headerfault': None } msg.resolve(wsdl, abstract_message_input) assert msg.signature() == 'arg1: xsd:string, arg2: xsd:string'
def test_urlreplacement_serialize(abstract_message_input): wsdl = stub(types=stub(_prefix_map={})) operation = stub(location='my-action/(arg1)/(arg2)/', name='foo') msg = messages.UrlReplacement(wsdl=wsdl, name=None, operation=operation) msg.namespace = { 'body': 'http://test.python-zeep.org/tests/rpc', 'header': None, 'headerfault': None } msg.resolve(wsdl, abstract_message_input) serialized = msg.serialize(arg1='ah1', arg2='ah2') assert serialized.headers == {'Content-Type': 'text/xml; charset=utf-8'} assert serialized.path == 'my-action/ah1/ah2/' assert serialized.content == ''