Пример #1
0
def test_prepare_soap_header():
    """Check that the SOAP header is correctly wrapped."""
    s = SoapMessage('endpoint', 'method')
    h = s.prepare_soap_header('<a><b></b></a>')
    assert h == "<s:Header><a><b></b></a></s:Header>"
    s = SoapMessage('endpoint', 'method', http_headers={
        'test1': 'one', 'test2': 'two'})
    h = s.prepare_soap_header(None)
    assert h == ''
Пример #2
0
def test_prepare_soap_header():
    """Check that the SOAP header is correctly wrapped."""
    s = SoapMessage("endpoint", "method")
    h = s.prepare_soap_header("<a><b></b></a>")
    assert h == "<s:Header><a><b></b></a></s:Header>"
    s = SoapMessage("endpoint",
                    "method",
                    http_headers={
                        "test1": "one",
                        "test2": "two"
                    })
    h = s.prepare_soap_header(None)
    assert h == ""