summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-02-22 14:29:26 -0500
committerRob Crittenden <rcritten@redhat.com>2010-02-26 12:31:11 -0500
commit766757e4d4d57c0dad881c1176ae318462203adc (patch)
treeaf1d917b1bba0db7f4405e5c7767d80b6fa1afa0 /ipalib
parent0700f4d7cae9b0b25214b117715dd91a6ccb1132 (diff)
downloadfreeipa-766757e4d4d57c0dad881c1176ae318462203adc.tar.gz
freeipa-766757e4d4d57c0dad881c1176ae318462203adc.tar.xz
freeipa-766757e4d4d57c0dad881c1176ae318462203adc.zip
Fix unicode failures in Env tests and dn failures in XML-RPC tests
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/__init__.py2
-rw-r--r--ipalib/config.py16
-rw-r--r--ipalib/frontend.py2
3 files changed, 10 insertions, 10 deletions
diff --git a/ipalib/__init__.py b/ipalib/__init__.py
index beaf0ab5..51b63c9f 100644
--- a/ipalib/__init__.py
+++ b/ipalib/__init__.py
@@ -754,7 +754,7 @@ For example:
>>> api.register(motd)
>>> api.finalize()
>>> api.Command.motd()
-{'result': 'Hello, world!'}
+{'result': u'Hello, world!'}
Also see the `plugable.API.bootstrap_with_global_options()` method.
diff --git a/ipalib/config.py b/ipalib/config.py
index 8597645a..1dbd5b7c 100644
--- a/ipalib/config.py
+++ b/ipalib/config.py
@@ -54,17 +54,17 @@ class Env(object):
>>> env = Env()
>>> env.attr = 'I was set as an attribute.'
>>> env.attr
- 'I was set as an attribute.'
+ u'I was set as an attribute.'
>>> env['attr'] # Also retrieve as a dictionary item
- 'I was set as an attribute.'
+ u'I was set as an attribute.'
Or you can set a variable as a dictionary item:
>>> env['item'] = 'I was set as a dictionary item.'
>>> env['item']
- 'I was set as a dictionary item.'
+ u'I was set as a dictionary item.'
>>> env.item # Also retrieve as an attribute
- 'I was set as a dictionary item.'
+ u'I was set as a dictionary item.'
The variable names must be valid lower-case Python identifiers that neither
start nor end with an underscore. If your variable name doesn't meet these
@@ -101,7 +101,7 @@ class Env(object):
>>> env.not_false = 'false' # Not equal to repr(False)!
>>> env.not_false
- 'false'
+ u'false'
If an ``str`` value looks like an integer, it's automatically converted to
the ``int`` type. Likewise, if an ``str`` value looks like a floating-point
@@ -119,7 +119,7 @@ class Env(object):
>>> env.message = ' Hello! ' # Surrounded by double spaces
>>> env.message
- 'Hello!'
+ u'Hello!'
>>> env.number = ' 42 ' # Still converted to an int
>>> env.number
42
@@ -140,7 +140,7 @@ class Env(object):
>>> env.date = 'Second'
Traceback (most recent call last):
...
- AttributeError: cannot override Env.date value 'First' with 'Second'
+ AttributeError: cannot override Env.date value u'First' with 'Second'
An `Env` instance can be *locked*, after which no further variables can be
set. Trying to set variables on a locked `Env` instance will also raise
@@ -400,7 +400,7 @@ class Env(object):
>>> env = Env()
>>> env.home = '/people/joe'
>>> env._join('home', 'Music', 'favourites')
- '/people/joe/Music/favourites'
+ u'/people/joe/Music/favourites'
"""
if key in self and self[key] is not None:
return path.join(self[key], *parts)
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index 4d0df3a5..e3828bf8 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -301,7 +301,7 @@ class HasParam(Plugin):
>>> bar = Env(context='bar')
>>> another = Env(context='another')
>>> (foo.context, bar.context, another.context)
- ('foo', 'bar', 'another')
+ (u'foo', u'bar', u'another')
>>> list(eg._filter_param_by_context('args', foo))
[Str('foo_only', include=['foo']), Str('not_bar', exclude=['bar']), Str('both')]
>>> list(eg._filter_param_by_context('args', bar))