def test_create_method_list_param(self): xml = utils.open_document('tests/assets/generation/list_param.xsd') code = xsd2py.generate_code_from_xsd(xml) if six.PY3: code = code.decode() assert_contains('def create(cls, Items):', code) assert_contains('instance.Items = Items', code) assert_not_contains('Itemss', code)
def test_evaluate_service_location(self): handler, _ = echo_handler() service = echo_service(handler) service.location = '{scheme}://{host}/ws' dispatcher = SOAPDispatcher(service) request = SOAPRequest(dict(REQUEST_METHOD='GET', QUERY_STRING='wsdl', HTTP_HOST='soap.example'), '') response = dispatcher.dispatch(request) self.assert_is_successful_response(response) assert_not_contains('{scheme}', response.http_content.decode()) assert_not_contains('{http}', response.http_content.decode())
def test_evaluate_service_location(self): handler, _ = echo_handler() service = echo_service(handler) service.location = '{scheme}://{host}/ws' dispatcher = SOAPDispatcher(service) request = SOAPRequest( dict(REQUEST_METHOD='GET', QUERY_STRING='wsdl', HTTP_HOST='soap.example'), '') response = dispatcher.dispatch(request) self.assert_is_successful_response(response) assert_not_contains('{scheme}', response.http_content.decode()) assert_not_contains('{http}', response.http_content.decode())
def assert_fail(self, value, actual_iterable, message=None): return assert_raises(AssertionError, lambda: assert_not_contains(value, actual_iterable, message=message))
def test_passes_if_iterable_does_not_contain_value(self): assert_not_contains(None, ['foo', True]) assert_not_contains('bar', ('foo', True))
def assert_fail(self, value, actual_iterable, message=None): return assert_raises( AssertionError, lambda: assert_not_contains( value, actual_iterable, message=message))