mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #45538 from gtmanfred/2017.7.3
Backport test fixes to 2017.7.3
This commit is contained in:
commit
7bc60c56d4
7 changed files with 1317 additions and 3 deletions
|
@ -254,10 +254,10 @@ class PkgModuleTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
self.assertIn('bash-completion', keys)
|
||||
self.assertIn('dpkg', keys)
|
||||
elif os_family == 'RedHat':
|
||||
ret = self.run_function(func, ['rpm', 'yum'])
|
||||
ret = self.run_function(func, ['rpm', 'bash'])
|
||||
keys = ret.keys()
|
||||
self.assertIn('rpm', keys)
|
||||
self.assertIn('yum', keys)
|
||||
self.assertIn('bash', keys)
|
||||
elif os_family == 'Suse':
|
||||
ret = self.run_function(func, ['less', 'zypper'])
|
||||
keys = ret.keys()
|
||||
|
|
1296
tests/unit/files/endpoints.json
Normal file
1296
tests/unit/files/endpoints.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -5,11 +5,16 @@ from __future__ import absolute_import
|
|||
import logging
|
||||
from copy import deepcopy
|
||||
import pkg_resources
|
||||
import os.path
|
||||
|
||||
# imprt salt paths
|
||||
from tests.support.paths import TESTS_DIR
|
||||
|
||||
# import Python Third Party Libs
|
||||
# pylint: disable=import-error
|
||||
try:
|
||||
import boto
|
||||
boto.ENDPOINTS_PATH = os.path.join(TESTS_DIR, 'unit/files/endpoints.json')
|
||||
import boto.ec2.elb
|
||||
HAS_BOTO = True
|
||||
except ImportError:
|
||||
|
|
|
@ -5,11 +5,13 @@ from __future__ import absolute_import
|
|||
import random
|
||||
import string
|
||||
from copy import deepcopy
|
||||
import os.path
|
||||
|
||||
# Import Salt Testing Libs
|
||||
from tests.support.mixins import LoaderModuleMockMixin
|
||||
from tests.support.unit import skipIf, TestCase
|
||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON
|
||||
from tests.support.paths import TESTS_DIR
|
||||
|
||||
# Import Salt libs
|
||||
import salt.config
|
||||
|
@ -23,6 +25,7 @@ import salt.modules.boto_secgroup as boto_secgroup
|
|||
from salt.ext.six.moves import range # pylint: disable=redefined-builtin
|
||||
try:
|
||||
import boto
|
||||
boto.ENDPOINTS_PATH = os.path.join(TESTS_DIR, 'unit/files/endpoints.json')
|
||||
import boto.ec2 # pylint: enable=unused-import
|
||||
HAS_BOTO = True
|
||||
except ImportError:
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
from __future__ import absolute_import
|
||||
import random
|
||||
import string
|
||||
import os.path
|
||||
# pylint: disable=3rd-party-module-not-gated
|
||||
import pkg_resources
|
||||
from pkg_resources import DistributionNotFound
|
||||
|
@ -16,6 +17,7 @@ from pkg_resources import DistributionNotFound
|
|||
from tests.support.mixins import LoaderModuleMockMixin
|
||||
from tests.support.unit import skipIf, TestCase
|
||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
||||
from tests.support.paths import TESTS_DIR
|
||||
|
||||
# Import Salt libs
|
||||
import salt.config
|
||||
|
@ -32,6 +34,7 @@ from salt.ext.six.moves import range # pylint: disable=redefined-builtin
|
|||
# pylint: disable=no-name-in-module,unused-import
|
||||
try:
|
||||
import boto
|
||||
boto.ENDPOINTS_PATH = os.path.join(TESTS_DIR, 'unit/files/endpoints.json')
|
||||
import boto3
|
||||
from boto.exception import BotoServerError
|
||||
HAS_BOTO = True
|
||||
|
@ -103,7 +106,7 @@ def _get_moto_version():
|
|||
Returns the moto version
|
||||
'''
|
||||
try:
|
||||
return LooseVersion(moto.__version__)
|
||||
return LooseVersion(six.text_type(moto.__version__))
|
||||
except AttributeError:
|
||||
try:
|
||||
return LooseVersion(pkg_resources.get_distribution('moto').version)
|
||||
|
|
|
@ -4,11 +4,14 @@
|
|||
from __future__ import absolute_import
|
||||
import random
|
||||
import string
|
||||
import os.path
|
||||
|
||||
# Import Salt Testing libs
|
||||
from tests.support.mixins import LoaderModuleMockMixin
|
||||
from tests.support.unit import skipIf, TestCase
|
||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch
|
||||
from tests.support.paths import TESTS_DIR
|
||||
|
||||
|
||||
# Import Salt libs
|
||||
import salt.utils.boto
|
||||
|
@ -23,6 +26,7 @@ from tests.unit.modules.test_boto_vpc import BotoVpcTestCaseMixin
|
|||
from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin
|
||||
try:
|
||||
import boto
|
||||
boto.ENDPOINTS_PATH = os.path.join(TESTS_DIR, 'unit/files/endpoints.json')
|
||||
import boto3
|
||||
from boto.exception import BotoServerError
|
||||
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import
|
||||
import os.path
|
||||
|
||||
# Import Salt Testing libs
|
||||
from tests.support.mixins import LoaderModuleMockMixin
|
||||
from tests.support.unit import skipIf, TestCase
|
||||
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
|
||||
from tests.support.paths import TESTS_DIR
|
||||
|
||||
# Import Salt libs
|
||||
import salt.utils.boto
|
||||
|
@ -18,6 +20,7 @@ from salt.utils.versions import LooseVersion
|
|||
# pylint: disable=import-error
|
||||
try:
|
||||
import boto
|
||||
boto.ENDPOINTS_PATH = os.path.join(TESTS_DIR, 'unit/files/endpoints.json')
|
||||
import boto.exception
|
||||
from boto.exception import BotoServerError
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue