Skip to content

Commit

Permalink
Merge branch 'move-functional-tests' into develop
Browse files Browse the repository at this point in the history
* move-functional-tests:
  Move test_utils over to functional tests
  Remove dynamodb test
  Remove resource smoke test to functional test
  • Loading branch information
jamesls committed Apr 29, 2015
2 parents 3cf8cf8 + 0f58edd commit fec3bf9
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 49 deletions.
47 changes: 47 additions & 0 deletions tests/functional/test_smoke.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from nose.tools import assert_true

from boto3.session import Session


def create_session():
session = Session(aws_access_key_id='dummy',
aws_secret_access_key='dummy',
region_name='us-east-1')
return session


def test_can_create_all_resources():
"""Verify we can create all existing resources."""
session = create_session()
for service_name in session.get_available_resources():
yield _test_create_resource, session, service_name


def _test_create_resource(session, service_name):
resource = session.resource(service_name)
# Verifying we have a "meta" attr is just an arbitrary
# sanity check.
assert_true(hasattr(resource, 'meta'))


def test_can_create_all_clients():
session = create_session()
for service_name in session.get_available_services():
yield _test_create_client, session, service_name


def _test_create_client(session, service_name):
client = session.client(service_name)
assert_true(hasattr(client, 'meta'))
File renamed without changes.
30 changes: 0 additions & 30 deletions tests/integration/test_dynamodb.py

This file was deleted.

19 changes: 0 additions & 19 deletions tests/unit/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,6 @@
from tests import mock, BaseTestCase


def test_create_all_resources():
"""
This generator yields test functions for each available
resource via its service name. Individual tests can fail
indepdendently to let you know which services are not
working and why.
"""
session = Session(aws_access_key_id='dummy',
aws_secret_access_key='dummy',
region_name='us-east-1')
for service_name in session.get_available_resources():
yield _test_create_resource, session, service_name


def _test_create_resource(session, service_name):
# Instantiate a resource and make sure no exceptions are thrown.
session.resource(service_name)


class TestSession(BaseTestCase):
def test_repr(self):
bc_session = self.bc_session_cls.return_value
Expand Down

0 comments on commit fec3bf9

Please sign in to comment.