summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@dreamhost.com>2014-06-14 10:10:21 -0700
committerDoug Hellmann <doug.hellmann@dreamhost.com>2014-06-18 06:42:21 -0700
commit57e22f17e92b4bdf8d7227fbbc73a6d2a2f12a9b (patch)
tree3e9c2e26ead276c73f1e3c4be9a181e5288837d0
parent68bb4ec065f7282c2480664143bc08e4d4759940 (diff)
downloadoslo-i18n-57e22f17e92b4bdf8d7227fbbc73a6d2a2f12a9b.tar.gz
Update sphinx and hacking requirements
Update the sphinx version allowed for building documentation. Update the version of hacking used for code checks. At the same time, fix the code that causes new checks in hacking 0.9 to fail. Change-Id: Iafbfaf961838de9e6a1c2f5d474929cafd049a70
-rw-r--r--oslo/i18n/_factory.py3
-rw-r--r--oslo/i18n/_locale.py5
-rw-r--r--test-requirements.txt4
-rw-r--r--tests/__init__.py13
-rw-r--r--tests/fakes.py6
-rw-r--r--tests/test_factory.py3
-rw-r--r--tests/test_gettextutils.py3
-rw-r--r--tests/test_handler.py3
-rw-r--r--tests/test_message.py3
-rw-r--r--tests/test_translate.py6
10 files changed, 18 insertions, 31 deletions
diff --git a/oslo/i18n/_factory.py b/oslo/i18n/_factory.py
index df00aaa..9390098 100644
--- a/oslo/i18n/_factory.py
+++ b/oslo/i18n/_factory.py
@@ -27,8 +27,7 @@ from oslo.i18n import _message
class TranslatorFactory(object):
- """Create translator functions
- """
+ "Create translator functions"
def __init__(self, domain, localedir=None):
"""Establish a set of translation functions for the domain.
diff --git a/oslo/i18n/_locale.py b/oslo/i18n/_locale.py
index 79d12fb..51908db 100644
--- a/oslo/i18n/_locale.py
+++ b/oslo/i18n/_locale.py
@@ -16,7 +16,10 @@
def get_locale_dir_variable_name(domain):
- """Convert a translation domain name to a variable for specifying
+ """Build environment variable name for local dir.
+
+ Convert a translation domain name to a variable for specifying
a separate locale dir.
+
"""
return domain.upper().replace('.', '_').replace('-', '_') + '_LOCALEDIR'
diff --git a/test-requirements.txt b/test-requirements.txt
index 2fbb5fd..9c1b733 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,6 +1,6 @@
-hacking>=0.8.0,<0.9
+hacking>=0.9.2,<0.10
-sphinx>=1.1.2,<1.2
+sphinx>=1.1.2,!=1.2.0,<1.3
oslosphinx
oslotest
diff --git a/tests/__init__.py b/tests/__init__.py
index 19f5e72..e69de29 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,13 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# 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.
diff --git a/tests/fakes.py b/tests/fakes.py
index baf404f..6bed973 100644
--- a/tests/fakes.py
+++ b/tests/fakes.py
@@ -36,7 +36,9 @@ class FakeTranslations(gettext.GNUTranslations):
@staticmethod
def translator(locales_map):
- """Returns a mock gettext.translation function that uses
+ """Build mock translator for the given locales.
+
+ Returns a mock gettext.translation function that uses
individual TestTranslations to translate in the given locales.
:param locales_map: A map from locale name to a translations map.
@@ -44,6 +46,8 @@ class FakeTranslations(gettext.GNUTranslations):
'es': {'Hi': 'Hola', 'Bye': 'Adios'},
'zh': {'Hi': 'Ni Hao', 'Bye': 'Zaijian'}
}
+
+
"""
def _translation(domain, localedir=None,
languages=None, fallback=None):
diff --git a/tests/test_factory.py b/tests/test_factory.py
index 112960f..4bdef17 100644
--- a/tests/test_factory.py
+++ b/tests/test_factory.py
@@ -15,9 +15,8 @@
# under the License.
import mock
-import six
-
from oslotest import base as test_base
+import six
from oslo.i18n import _lazy
from oslo.i18n import _message
diff --git a/tests/test_gettextutils.py b/tests/test_gettextutils.py
index 8797e1f..49996ed 100644
--- a/tests/test_gettextutils.py
+++ b/tests/test_gettextutils.py
@@ -19,10 +19,9 @@ import logging
from babel import localedata
import mock
-import six
-
from oslotest import base as test_base
from oslotest import moxstubout
+import six
from oslo.i18n import _lazy
from oslo.i18n import _message
diff --git a/tests/test_handler.py b/tests/test_handler.py
index 71b264f..01cc8cc 100644
--- a/tests/test_handler.py
+++ b/tests/test_handler.py
@@ -20,10 +20,9 @@ import mock
from oslotest import base as test_base
import six
-from tests import fakes
-
from oslo.i18n import _message
from oslo.i18n import log as i18n_log
+from tests import fakes
LOG = logging.getLogger(__name__)
diff --git a/tests/test_message.py b/tests/test_message.py
index 378fc65..6340729 100644
--- a/tests/test_message.py
+++ b/tests/test_message.py
@@ -23,11 +23,10 @@ from oslotest import base as test_base
import six
import testtools
+from oslo.i18n import _message
from tests import fakes
from tests import utils
-from oslo.i18n import _message
-
LOG = logging.getLogger(__name__)
diff --git a/tests/test_translate.py b/tests/test_translate.py
index 2fad7c3..9e378dd 100644
--- a/tests/test_translate.py
+++ b/tests/test_translate.py
@@ -17,14 +17,12 @@
from __future__ import unicode_literals
import mock
-
from oslotest import base as test_base
-from tests import fakes
-from tests import utils
-
from oslo.i18n import _message
from oslo.i18n import _translate
+from tests import fakes
+from tests import utils
class TranslateTest(test_base.BaseTestCase):