Merge "Skip boto 2.x tests if boto is not installed"
This commit is contained in:
commit
839537f40e
@ -24,6 +24,10 @@ import os
|
||||
import test.functional as tf
|
||||
from test.functional.s3api.s3_test_client import (
|
||||
Connection, get_boto3_conn, tear_down_s3)
|
||||
try:
|
||||
import boto
|
||||
except ImportError:
|
||||
boto = None
|
||||
|
||||
|
||||
def setUpModule():
|
||||
@ -52,6 +56,8 @@ class S3ApiBase(unittest.TestCase):
|
||||
raise SkipTest('no s3api user configured')
|
||||
if 's3api' not in tf.cluster_info:
|
||||
raise SkipTest('s3api middleware is not enabled')
|
||||
if boto is None:
|
||||
raise SkipTest('boto 2.x library is not installed')
|
||||
if tf.config.get('account'):
|
||||
user_id = '%s:%s' % (tf.config['account'], tf.config['username'])
|
||||
else:
|
||||
|
@ -19,8 +19,14 @@ from six.moves.urllib.parse import urlparse
|
||||
import test.functional as tf
|
||||
import boto3
|
||||
from botocore.exceptions import ClientError
|
||||
from boto.s3.connection import S3Connection, OrdinaryCallingFormat, \
|
||||
S3ResponseError
|
||||
try:
|
||||
from boto.s3.connection import (
|
||||
S3Connection,
|
||||
OrdinaryCallingFormat,
|
||||
S3ResponseError,
|
||||
)
|
||||
except ImportError:
|
||||
S3Connection = OrdinaryCallingFormat = S3ResponseError = None
|
||||
import six
|
||||
import sys
|
||||
import traceback
|
||||
|
Loading…
Reference in New Issue
Block a user