def test_lint_waiter_configs():
    session = ibm_botocore.session.get_session()
    for service_name in session.get_available_services():
        client = session.create_client(service_name, 'us-east-1')
        service_model = client.meta.service_model
        for waiter_name in client.waiter_names:
            yield _lint_single_waiter, client, waiter_name, service_model
示例#2
0
def _all_inputs():
    session = ibm_botocore.session.get_session()
    for service_name in session.get_available_services():
        service_model = session.get_service_model(service_name)
        for operation_name in service_model.operation_names:
            operation_model = service_model.operation_model(operation_name)
            input_shape = operation_model.input_shape
            if input_shape is not None and input_shape.members:
                yield input_shape, service_name, operation_name
def test_can_generate_all_inputs():
    session = ibm_botocore.session.get_session()
    generator = ArgumentGenerator()
    for service_name in session.get_available_services():
        service_model = session.get_service_model(service_name)
        for operation_name in service_model.operation_names:
            operation_model = service_model.operation_model(operation_name)
            input_shape = operation_model.input_shape
            if input_shape is not None and input_shape.members:
                yield (_test_can_generate_skeleton, generator, input_shape,
                       service_name, operation_name)
示例#4
0
def _waiter_configs():
    session = ibm_botocore.session.get_session()
    validator = Draft4Validator(WAITER_SCHEMA)
    for service_name in session.get_available_services():
        client = session.create_client(service_name, 'us-east-1')
        try:
            # We use the loader directly here because we need the entire
            # json document, not just the portions exposed (either
            # internally or externally) by the WaiterModel class.
            loader = session.get_component('data_loader')
            waiter_model = loader.load_service_model(service_name, 'waiters-2')
        except UnknownServiceError:
            # The service doesn't have waiters
            continue
        yield validator, waiter_model, client
def test_docs_generated():
    """Verify we can generate the appropriate docs for all services"""
    botocore_session = ibm_botocore.session.get_session()
    session = ibm_boto3.Session(region_name='us-east-1')
    for service_name in session.get_available_services():
        generated_docs = ServiceDocumenter(service_name,
                                           session=session).document_service()
        generated_docs = generated_docs.decode('utf-8')
        client = ibm_boto3.client(service_name, 'us-east-1')

        # Check that all of the services have the appropriate title
        yield (_assert_has_title, generated_docs, client)

        # Check that all services have the client documented.
        yield (_assert_has_client_documentation, generated_docs, service_name,
               client)

        # If the client can paginate, make sure the paginators are documented.
        try:
            paginator_model = botocore_session.get_paginator_model(
                service_name)
            yield (_assert_has_paginator_documentation, generated_docs,
                   service_name, client,
                   sorted(paginator_model._paginator_config))
        except DataNotFoundError:
            pass

        # If the client has waiters, make sure the waiters are documented
        if client.waiter_names:
            waiter_model = botocore_session.get_waiter_model(service_name)
            yield (_assert_has_waiter_documentation, generated_docs,
                   service_name, client, waiter_model)

        # If the service has resources, make sure the service resource
        # is at least documented.
        if service_name in session.get_available_resources():
            resource = ibm_boto3.resource(service_name, 'us-east-1')
            yield (_assert_has_resource_documentation, generated_docs,
                   service_name, resource)
示例#6
0
def all_services():
    session = ibm_boto3.Session(region_name='us-east-1')
    yield from session.get_available_services()
 def test_get_aws_services_in_alphabetical_order(self):
     session = create_session(session_vars=self.env_vars)
     services = session.get_available_services()
     self.assertEqual(sorted(services), services)
示例#8
0
def _all_clients():
    session = create_session()
    for service_name in session.get_available_services():
        yield session, service_name
示例#9
0
def test_can_create_all_clients():
    session = create_session()
    for service_name in session.get_available_services():
        yield _test_create_client, session, service_name