diff --git a/test/__init__.py b/test/__init__.py index 0aaba02f8a..1ec2e62e7b 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -11,7 +11,11 @@ from swift.common.utils import readconf setattr(__builtin__, '_', lambda x: x) + def get_config(): + """ + Attempt to get a functional config dictionary. + """ config_file = os.environ.get('SWIFT_TEST_CONFIG_FILE', '/etc/swift/func_test.conf') config = {} @@ -24,4 +28,3 @@ def get_config(): except SystemExit: print >>sys.stderr, 'UNABLE TO READ FUNCTIONAL TESTS CONFIG FILE' return config - diff --git a/test/functional/tests.py b/test/functional/tests.py index eac80f0c7f..59dcf38960 100644 --- a/test/functional/tests.py +++ b/test/functional/tests.py @@ -29,7 +29,6 @@ import unittest import urllib from test import get_config - from swift import Account, AuthenticationFailed, Connection, Container, \ File, ResponseError diff --git a/test/functionalnosetests/swift_testing.py b/test/functionalnosetests/swift_testing.py index fbc60626c2..31df205efd 100644 --- a/test/functionalnosetests/swift_testing.py +++ b/test/functionalnosetests/swift_testing.py @@ -28,7 +28,7 @@ if conf: swift_test_auth += \ '://%(auth_host)s:%(auth_port)s%(auth_prefix)sv1.0' % conf except KeyError: - pass # skip + pass # skip if 'account' in conf: swift_test_user[0] = '%(account)s:%(username)s' % conf else: @@ -39,13 +39,13 @@ if conf: in conf else '', conf['username2']) swift_test_key[1] = conf['password2'] except KeyError, err: - pass # old conf, no second account tests can be run + pass # old conf, no second account tests can be run try: swift_test_user[2] = '%s%s' % ('%s:' % conf['account'] if 'account' in conf else '', conf['username3']) swift_test_key[2] = conf['password3'] except KeyError, err: - pass # old conf, no third account tests can be run + pass # old conf, no third account tests can be run skip = not all([swift_test_auth, swift_test_user[0], swift_test_key[0]]) if skip: @@ -73,7 +73,8 @@ class InternalServerError(Exception): url = [None, None, None] token = [None, None, None] parsed = [None, None, None] -conn = [None, None, None] +conn = [None, None, None] + def retry(func, *args, **kwargs): """ diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py index a5c8749f64..29cb65c6fe 100644 --- a/test/unit/common/test_utils.py +++ b/test/unit/common/test_utils.py @@ -667,7 +667,6 @@ log_name = yarr''' # make sure its accurate to 10th of a second self.assertTrue(abs(100 - (time.time() - start) * 100) < 10) - def test_search_tree(self): # file match & ext miss with temptree(['asdf.conf', 'blarg.conf', 'asdf.cfg']) as t: