def test_gettextutils_install(self): gettextutils.install('blaa') self.assertTrue(isinstance(_('A String'), six.text_type)) # noqa gettextutils.install('blaa', lazy=True) self.assertTrue(isinstance(_('A Message'), # noqa gettextutils.Message))
def test_gettextutils_install_with_enable(self): gettextutils.install('blaa') self.assertTrue(isinstance(_('A String'), six.text_type)) # noqa gettextutils.enable_lazy() self.assertTrue(isinstance(_('A Message'), # noqa gettextutils.Message))
def test_gettextutils_install(self): gettextutils.install('blaa') self.assertTrue(isinstance(_('A String'), unicode)) # noqa gettextutils.install('blaa', lazy=True) self.assertTrue( isinstance( _('A Message'), # noqa gettextutils.Message))
def prepare_service(argv=None): gettextutils.install('openstack') gettextutils.enable_lazy() log_levels = (cfg.CONF.default_log_levels) cfg.set_defaults(log.log_opts, default_log_levels=log_levels) if argv is None: argv = sys.argv cfg.CONF(argv[1:], project='monasca-anomaly') log.setup('monasca-anomaly') LOG.info('Service has started!')
def prepare_service(argv=None): gettextutils.install('openstack') gettextutils.enable_lazy() log_levels = (cfg.CONF.default_log_levels) cfg.set_defaults(log.log_opts, default_log_levels=log_levels) if argv is None: argv = sys.argv cfg.CONF(argv[1:], project='persister') log.setup('persister') LOG.info('Service has started!')
def test_gettext_install_looks_up_localedir(self): with mock.patch('os.environ.get') as environ_get: with mock.patch('gettext.install') as gettext_install: environ_get.return_value = '/foo/bar' gettextutils.install('blaa') environ_get.assert_called_once_with('BLAA_LOCALEDIR') gettext_install.assert_called_once_with('blaa', localedir='/foo/bar', unicode=True)
def test_gettext_install_looks_up_localedir(self): with mock.patch("os.environ.get") as environ_get: with mock.patch("gettext.install") as gettext_install: environ_get.return_value = "/foo/bar" gettextutils.install("blaa") environ_get.assert_called_once_with("BLAA_LOCALEDIR") if six.PY3: gettext_install.assert_called_once_with("blaa", localedir="/foo/bar") else: gettext_install.assert_called_once_with("blaa", localedir="/foo/bar", unicode=True)
from __future__ import print_function import imp import os import re import socket import sys import textwrap from oslo.config import cfg from openstack.common import gettextutils from openstack.common import importutils gettextutils.install('oslo') STROPT = "StrOpt" BOOLOPT = "BoolOpt" INTOPT = "IntOpt" FLOATOPT = "FloatOpt" LISTOPT = "ListOpt" MULTISTROPT = "MultiStrOpt" OPT_TYPES = { STROPT: 'string value', BOOLOPT: 'boolean value', INTOPT: 'integer value', FLOATOPT: 'floating point value', LISTOPT: 'list value', MULTISTROPT: 'multi valued',
from __future__ import print_function import imp import os import re import socket import sys import textwrap from oslo.config import cfg from openstack.common import gettextutils from openstack.common import importutils gettextutils.install("oslo") STROPT = "StrOpt" BOOLOPT = "BoolOpt" INTOPT = "IntOpt" FLOATOPT = "FloatOpt" LISTOPT = "ListOpt" MULTISTROPT = "MultiStrOpt" OPT_TYPES = { STROPT: "string value", BOOLOPT: "boolean value", INTOPT: "integer value", FLOATOPT: "floating point value", LISTOPT: "list value", MULTISTROPT: "multi valued",
def test_gettextutils_install(self): gettextutils.install("blaa") self.assertTrue(isinstance(_("A String"), six.text_type)) # noqa gettextutils.install("blaa", lazy=True) self.assertTrue(isinstance(_("A Message"), gettextutils.Message)) # noqa
def test_gettextutils_install(self): gettextutils.install('blaa') self.assertTrue(isinstance(_('A String'), six.text_type)) # noqa