Skip to content

Commit

Permalink
Merge "Only change collation for functional tests"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Apr 3, 2014
2 parents a1a9a2f + 5ea6c88 commit bc67415
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
32 changes: 32 additions & 0 deletions test/functional/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License 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.

import locale


config = {}
orig_collate = ''


def setup_package():
global orig_collate
orig_collate = locale.setlocale(locale.LC_COLLATE)
global config
locale.setlocale(locale.LC_COLLATE, config.get('collate', 'C'))


def teardown_package():
global orig_collate
locale.setlocale(locale.LC_COLLATE, orig_collate)
5 changes: 2 additions & 3 deletions test/functional/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
from nose import SkipTest

from test import get_config
from test.functional import config
from test.functional.swift_test_client import Account, Connection, File, \
ResponseError
from swift.common import constraints


config = get_config('func_test')
config.update(get_config('func_test'))
for k in constraints.DEFAULT_CONSTRAINTS:
if k in config:
# prefer what's in test.conf
Expand All @@ -60,8 +61,6 @@ def load_constraint(name):
raise SkipTest(c)
return c

locale.setlocale(locale.LC_COLLATE, config.get('collate', 'C'))


def chunks(s, length=3):
i, j = 0, length
Expand Down

0 comments on commit bc67415

Please sign in to comment.