mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't attempt connections at the module level!
This commit is contained in:
parent
c1a6e6a214
commit
4062bd9fd9
3 changed files with 17 additions and 36 deletions
|
@ -11,30 +11,25 @@ from tests.support.case import ModuleCase
|
|||
from tests.support.unit import skipIf
|
||||
|
||||
# Import 3rd-party libs
|
||||
NO_BOTO_MODULE = True
|
||||
BOTO_NOT_CONFIGURED = True
|
||||
try:
|
||||
import boto
|
||||
NO_BOTO_MODULE = False
|
||||
try:
|
||||
boto.connect_iam()
|
||||
BOTO_NOT_CONFIGURED = False
|
||||
except boto.exception.NoAuthHandlerFound:
|
||||
pass
|
||||
except ImportError:
|
||||
pass
|
||||
NO_BOTO_MODULE = True
|
||||
|
||||
|
||||
@skipIf(
|
||||
NO_BOTO_MODULE,
|
||||
'Please install the boto library before running boto integration tests.'
|
||||
)
|
||||
@skipIf(
|
||||
BOTO_NOT_CONFIGURED,
|
||||
'Please setup boto AWS credentials before running boto integration tests.'
|
||||
)
|
||||
class BotoIAMTest(ModuleCase):
|
||||
|
||||
def setUp(self):
|
||||
try:
|
||||
boto.connect_iam()
|
||||
except boto.exception.NoAuthHandlerFound:
|
||||
self.skipTest('Please setup boto AWS credentials before running boto integration tests.')
|
||||
|
||||
def test_get_account_id(self):
|
||||
ret = self.run_function('boto_iam.get_account_id')
|
||||
# The AWS account ID is a 12-digit number.
|
||||
|
|
|
@ -12,31 +12,24 @@ from tests.support.case import ModuleCase
|
|||
from tests.support.unit import skipIf
|
||||
|
||||
# Import 3rd-party libs
|
||||
NO_BOTO_MODULE = True
|
||||
BOTO_NOT_CONFIGURED = True
|
||||
try:
|
||||
import boto
|
||||
NO_BOTO_MODULE = False
|
||||
try:
|
||||
boto.connect_iam()
|
||||
BOTO_NOT_CONFIGURED = False
|
||||
except boto.exception.NoAuthHandlerFound:
|
||||
pass
|
||||
except ImportError:
|
||||
pass
|
||||
NO_BOTO_MODULE = True
|
||||
|
||||
|
||||
@skipIf(
|
||||
NO_BOTO_MODULE,
|
||||
'Please install the boto library before running boto integration tests.'
|
||||
)
|
||||
@skipIf(
|
||||
BOTO_NOT_CONFIGURED,
|
||||
'Please setup boto AWS credentials before running boto integration tests.'
|
||||
)
|
||||
class BotoSNSTest(ModuleCase):
|
||||
|
||||
def setUp(self):
|
||||
try:
|
||||
boto.connect_iam()
|
||||
except boto.exception.NoAuthHandlerFound:
|
||||
self.skipTest('Please setup boto AWS credentials before running boto integration tests.')
|
||||
# The name of the topic you want to create.
|
||||
# Constraints: Topic names must be made up of only uppercase and
|
||||
# lowercase ASCII letters, numbers, underscores, and hyphens,
|
||||
|
|
|
@ -13,31 +13,24 @@ from tests.support.unit import skipIf
|
|||
from tests.support.mixins import SaltReturnAssertsMixin
|
||||
|
||||
# Import 3rd-party libs
|
||||
NO_BOTO_MODULE = True
|
||||
BOTO_NOT_CONFIGURED = True
|
||||
try:
|
||||
import boto
|
||||
NO_BOTO_MODULE = False
|
||||
try:
|
||||
boto.connect_iam()
|
||||
BOTO_NOT_CONFIGURED = False
|
||||
except boto.exception.NoAuthHandlerFound:
|
||||
pass
|
||||
except ImportError:
|
||||
pass
|
||||
NO_BOTO_MODULE = True
|
||||
|
||||
|
||||
@skipIf(
|
||||
NO_BOTO_MODULE,
|
||||
'Please install the boto library before running boto integration tests.'
|
||||
)
|
||||
@skipIf(
|
||||
BOTO_NOT_CONFIGURED,
|
||||
'Please setup boto AWS credentials before running boto integration tests.'
|
||||
)
|
||||
class BotoSNSTest(ModuleCase, SaltReturnAssertsMixin):
|
||||
|
||||
def setUp(self):
|
||||
try:
|
||||
boto.connect_iam()
|
||||
except boto.exception.NoAuthHandlerFound:
|
||||
self.skipTest('Please setup boto AWS credentials before running boto integration tests.')
|
||||
# The name of the topic you want to create.
|
||||
# Constraints: Topic names must be made up of only uppercase and
|
||||
# lowercase ASCII letters, numbers, underscores, and hyphens,
|
||||
|
|
Loading…
Add table
Reference in a new issue