"""Smoke tests to verify basic communication to all AWS services."""
import botocore.session

from nose.tools import assert_equals


REGION = 'us-east-1'
SMOKE_TESTS = {
 'autoscaling': {'DescribeAccountLimits': {},
                 'DescribeAdjustmentTypes': {}},
 'cloudformation': {'DescribeStacks': {},
                    'ListStacks': {}},
 'cloudfront': {'ListDistributions': {},
                'ListStreamingDistributions': {}},
 'cloudsearch': {'DescribeDomains': {},
                 'ListDomainNames': {}},
 'cloudtrail': {'DescribeTrails': {}},
 'cloudwatch': {'ListMetrics': {}},
 'cognito-identity': {'ListIdentityPools': {'maxResults': 1}},
 'cognito-sync': {'ListIdentityPoolUsage': {}},
 'datapipeline': {'ListPipelines': {}},
 'directconnect': {'DescribeConnections': {}},
 'dynamodb': {'ListTables': {}},
 'ec2': {'DescribeRegions': {},
         'DescribeInstances': {}},
 'elasticache': {'DescribeCacheClusters': {}},
 'elasticbeanstalk': {'DescribeApplications': {}},
 'elastictranscoder': {'ListPipelines': {}},
 'elb': {'DescribeLoadBalancers': {}},
 'emr': {'ListClusters': {}},
 'iam': {'ListUsers': {}},
 'importexport': {'ListJobs': {}},
 'kinesis': {'ListStreams': {}},
 'logs': {'DescribeLogGroups': {}},
 'opsworks': {'DescribeStacks': {}},
 'rds': {'DescribeDBInstances': {}},
 'redshift': {'DescribeClusters': {}},
 'route53': {'ListHostedZones': {}},
 's3': {'ListBuckets': {}},
 'sdb': {'ListDomains': {}},
 'ses': {'ListIdentities': {}},
 'sns': {'ListTopics': {}},
 'sqs': {'ListQueues': {}},
 'storagegateway': {'ListGateways': {}},
 'sts': {'GetSessionToken': {}},
 # Subscription needed for support API calls.
 'support': {},
 'swf': {'ListDomains': {'RegistrationStatus': 'REGISTERED'}},
}


def test_can_make_request():
    session = botocore.session.get_session()
    for service_name in SMOKE_TESTS:
        service = session.get_service(service_name)
        endpoint = service.get_endpoint(REGION)
        for operation_name in SMOKE_TESTS[service_name]:
            kwargs = SMOKE_TESTS[service_name][operation_name]
            yield _make_call, service, endpoint, operation_name, kwargs


def _make_call(service, endpoint, operation_name, kwargs):
    operation = service.get_operation(operation_name)
    response, parsed = operation.call(endpoint, **kwargs)
    assert_equals(response.status_code, 200)

@@ -1125,16 +1125,97 @@
 : %7B%7D%7D,%0A 
+# Does not work with session credentials so%0A # importexport tests are not run.%0A #
 'importe
@@ -1240,16 +1240,37 @@
 ': %7B%7D%7D,%0A
+ 'importexport': %7B%7D,%0A
  'kinesi
@@ -1667,16 +1667,177 @@
 : %7B%7D%7D,%0A 
+# sts tests would normally go here, but%0A # there aren't any calls you can make when%0A # using session credentials so we don't run any%0A # sts tests.%0A 'sts': %7B%7D,%0A #
 'sts': %7B

Disable integ smoke tests requiring non-session creds