本文整理汇总了Python中spyne.test.interface.wsdl.build_app函数的典型用法代码示例。如果您正苦于以下问题:Python build_app函数的具体用法?Python build_app怎么用?Python build_app使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了build_app函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_default_port_type
def test_default_port_type(self):
# Test the default port is created
# Test the default port has the correct name
app = build_app([TDefaultPortService()], "DefaultPortTest", "DefaultPortName")
wrapper = AppTestWrapper(app)
self._default_port_type(wrapper, "DefaultPortName", 1)
示例2: test_port_count
def test_port_count(self):
sa = build_app([TSinglePortService()], 'tns', name='SinglePortApp')
wsdl = Wsdl11(sa.interface)
wsdl.build_interface_document(self.url)
sa_wsdl_el = wsdl.root_elt
self.assertEquals(1, len(sa_wsdl_el.findall(self.port_type_string)))
pl = sa_wsdl_el.findall(self.port_type_string)
self.assertEqual(1, len(pl))
da = build_app([TDoublePortService()], 'tns', name='DoublePortApp')
wsdl = Wsdl11(da.interface)
wsdl.build_interface_document(self.url)
from lxml import etree
print(etree.tostring(wsdl.root_elt, pretty_print=True))
self.assertEquals(2, len(wsdl.root_elt.findall(self.port_type_string)))
示例3: test_default_binding_multiple
def test_default_binding_multiple(self):
app = build_app(
[TDefaultPortServiceMultipleMethods()],
'DefaultPortTest',
'MultipleDefaultBindingNameApp'
)
wrapper = AppTestWrapper(app)
self._default_binding(wrapper, 'MultipleDefaultBindingNameApp', 3)
示例4: test_default_binding
def test_default_binding(self):
app = build_app(
[TDefaultPortService()],
'DefaultPortTest',
'DefaultBindingName'
)
wrapper = AppTestWrapper(app)
self._default_binding(wrapper, "DefaultBindingName", 1)
示例5: test_default_port_type_multiple
def test_default_port_type_multiple(self):
app = build_app(
[TDefaultPortServiceMultipleMethods()],
'DefaultServiceTns',
'MultipleDefaultPortServiceApp'
)
wrapper = AppTestWrapper(app)
self._default_port_type(wrapper, "MultipleDefaultPortServiceApp", 3)
示例6: test_port_name
def test_port_name(self):
sa = build_app([TSinglePortService()], 'tns', name='SinglePortApp')
wsdl = Wsdl11(sa.interface)
wsdl.build_interface_document(self.url)
sa_wsdl_el = wsdl.root_elt
pl = sa_wsdl_el.findall(self.port_type_string)
print(('\n', pl, pl[0].attrib))
self.assertEqual('FirstPortType', pl[0].get('name'))
da = build_app([TDoublePortService()], 'tns', name='DoublePortApp')
wsdl = Wsdl11(da.interface)
wsdl.build_interface_document(self.url)
da_wsdl_el = wsdl.root_elt
pl2 = da_wsdl_el.findall(self.port_type_string)
self.assertEqual('FirstPort', pl2[0].get('name'))
self.assertEqual('SecondPort', pl2[1].get('name'))
示例7: test_tns
def test_tns(self):
sa = build_app([TSinglePortService()], 'SinglePort', 'TestServiceName')
wsdl = Wsdl11(sa.interface)
wsdl.build_interface_document(self.url)
sa_el = wsdl.root_elt
tns = sa_el.get('targetNamespace')
self.assertEqual('SinglePort', tns)
sa = build_app(
[TSinglePortService(), TDoublePortService()],
'MultiServiceTns',
'AppName'
)
wsdl = Wsdl11(sa.interface)
wsdl.build_interface_document(self.url)
tns = wsdl.root_elt.get('targetNamespace')
self.assertEqual(tns, 'MultiServiceTns')
示例8: test_service_name
def test_service_name(self):
sa = build_app([TSinglePortService()], 'SinglePort', 'TestServiceName')
wsdl = Wsdl11(sa.interface)
wsdl.build_interface_document(self.url)
sa_el = wsdl.root_elt
sl = [s for s in sa_el.iterfind(self.service_string)]
name = sl[0].get('name')
print((len(sl)))
self.assertEqual('SinglePortService_ServiceInterface', name)
示例9: test_raise_invalid_port
def test_raise_invalid_port(self):
app = build_app(
[TBadRPCPortService()],
'MisingPortTns',
'MissingPortApp'
)
interface_doc = Wsdl11(app.interface)
self.assertRaises(ValueError, interface_doc.build_interface_document,
self.url)
app = build_app(
[TBadRPCPortService(), TSinglePortService()],
'MissingPort2Tns',
'MissingPortApp'
)
interface_doc = Wsdl11(app.interface)
self.assertRaises(ValueError, interface_doc.build_interface_document,
self.url)
示例10: test_default_binding_methods
def test_default_binding_methods(self):
app = build_app(
[TDefaultPortService()],
'DefaultPortTest',
'DefaultPortMethods'
)
wrapper = AppTestWrapper(app)
self._default_binding_methods(
wrapper,
1,
['echo_default_port_service']
)
示例11: test_raise_missing_port
def test_raise_missing_port(self):
# Test that an exception is raised when a port is declared in the service class
# but the rpc method does not declare a port.
app = build_app(
[TMissingRPCPortService()],
'MisingPortTns',
'MissingPortApp'
)
interface_doc = Wsdl11(app.interface)
self.assertRaises(ValueError, interface_doc.build_interface_document,
self.url)
app = build_app(
[TSinglePortService(), TMissingRPCPortService()],
'MissingPort2Tns',
'MissingPort2App'
)
interface_doc = Wsdl11(app.interface)
self.assertRaises(ValueError, interface_doc.build_interface_document,
self.url)
示例12: test_default_binding_methods_multiple
def test_default_binding_methods_multiple(self):
app = build_app(
[TDefaultPortServiceMultipleMethods()],
'DefaultBindingMethodsTns',
'MultipleDefaultBindMethodsApp'
)
wrapper = AppTestWrapper(app)
self._default_binding_methods(
wrapper,
3,
['echo_one', 'echo_two', 'echo_three']
)
示例13: test_service_contains_ports
def test_service_contains_ports(self):
# Check that the element for the service has the correct number of ports
# Check that the element for the service has the correct port names
app = build_app(
[TSinglePortService()],
'SinglePortTns',
'SinglePortApp'
)
wrapper = AppTestWrapper(app)
service = wrapper.get_service_list()[0]
# verify that there is only one port
ports = wrapper.get_port_list(service)
self.assertEquals(1, len(ports))
# verify that the ports name matched the port specified in
# the service class
port = ports[0]
self.assertEquals('FirstPortType', port.get('name'))
示例14: test_default_binding_methods
def test_default_binding_methods(self):
app = build_app([TDefaultPortService()], "DefaultPortTest", "DefaultPortMethods")
wrapper = AppTestWrapper(app)
self._default_binding_methods(wrapper, 1, ["echo_default_port_service"])