summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib/test_config.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-12-30 15:02:15 -0700
committerJason Gerard DeRose <jderose@redhat.com>2008-12-30 15:02:15 -0700
commit379c549fc16fbb2eed6685f5e189da26f021abe9 (patch)
treef0b04bfaf2d0a968faa7253ae7b6bdc3cddaadf0 /tests/test_ipalib/test_config.py
parentbc2395724708abc80c7c13c5474cefcfb6f3579c (diff)
downloadfreeipa-379c549fc16fbb2eed6685f5e189da26f021abe9.tar.gz
freeipa-379c549fc16fbb2eed6685f5e189da26f021abe9.tar.xz
freeipa-379c549fc16fbb2eed6685f5e189da26f021abe9.zip
Env now supports float values
Diffstat (limited to 'tests/test_ipalib/test_config.py')
-rw-r--r--tests/test_ipalib/test_config.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/test_ipalib/test_config.py b/tests/test_ipalib/test_config.py
index 5daad037f..ab8d90063 100644
--- a/tests/test_ipalib/test_config.py
+++ b/tests/test_ipalib/test_config.py
@@ -1,5 +1,6 @@
# Authors:
# Martin Nagy <mnagy@redhat.com>
+# Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
@@ -41,6 +42,8 @@ good_vars = (
('trailing_whitespace', ' value ', 'value'),
('an_int', 42, 42),
('int_repr', ' 42 ', 42),
+ ('a_float', 3.14, 3.14),
+ ('float_repr', ' 3.14 ', 3.14),
('true', True, True),
('true_repr', ' True ', True),
('false', False, False),
@@ -120,9 +123,12 @@ key3 = var3
config_good = """
[global]
+string = Hello world!
+null = None
yes = True
no = False
number = 42
+floating = 3.14
"""
@@ -372,11 +378,15 @@ class test_Env(ClassChecker):
good = tmp.join('good.conf')
open(good, 'w').write(config_good)
assert path.isfile(good)
- assert o._merge_from_file(good) == (3, 3)
- assert list(o) == sorted(keys + ('yes', 'no', 'number'))
+ assert o._merge_from_file(good) == (6, 6)
+ added = ('string', 'null', 'yes', 'no', 'number', 'floating')
+ assert list(o) == sorted(keys + added)
+ assert o.string == 'Hello world!'
+ assert o.null is None
assert o.yes is True
assert o.no is False
assert o.number == 42
+ assert o.floating == 3.14
def new(self):
"""