From 3c36e05d82659c8710bb6646dd851b204d4226e5 Mon Sep 17 00:00:00 2001 From: gwen Date: Mon, 6 Jan 2014 14:40:29 +0100 Subject: [PATCH] adds test for an API --- test/test_option_type.py | 10 ++++++++++ tiramisu/setting.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/test/test_option_type.py b/test/test_option_type.py index 6f1970a..3537d6d 100644 --- a/test/test_option_type.py +++ b/test/test_option_type.py @@ -75,6 +75,16 @@ def test_group_is_hidden(): prop = err.proptype assert 'hidden' in prop +def test_extend_properties(): + descr = make_description() + config = Config(descr) + setting = config.cfgimpl_get_settings() + config.read_write() + gc = config.unwrap_from_path('gc') + config.unwrap_from_path('gc.dummy') + setting[gc].extend(['hidden', 'user_defined_property']) + assert 'hidden' in setting[gc] + assert 'user_defined_property' in setting[gc] def test_group_is_hidden_multi(): descr = make_description() diff --git a/tiramisu/setting.py b/tiramisu/setting.py index 3b4d2f7..a9fce8d 100644 --- a/tiramisu/setting.py +++ b/tiramisu/setting.py @@ -289,7 +289,7 @@ class Property(object): :param propnames: an iterable made of property names :type propnames: iterable of string """ - for propname in propname: + for propname in propnames: self.append(propname) def reset(self):