コード例 #1
0
ファイル: code_test.py プロジェクト: Eveler/dmsic
 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)
コード例 #2
0
 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)
コード例 #3
0
 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())
コード例 #4
0
 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())
コード例 #5
0
 def assert_fail(self, value, actual_iterable, message=None):
     return assert_raises(AssertionError, lambda: assert_not_contains(value, actual_iterable, message=message))
コード例 #6
0
 def test_passes_if_iterable_does_not_contain_value(self):
     assert_not_contains(None, ['foo', True])
     assert_not_contains('bar', ('foo', True))
コード例 #7
0
 def assert_fail(self, value, actual_iterable, message=None):
     return assert_raises(
         AssertionError, lambda: assert_not_contains(
             value, actual_iterable, message=message))
コード例 #8
0
 def test_passes_if_iterable_does_not_contain_value(self):
     assert_not_contains(None, ['foo', True])
     assert_not_contains('bar', ('foo', True))