From eb62d0c4a4433b7b40e4d820f8e438aeeb4037f2 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 29 Aug 2013 09:29:28 +0200 Subject: [PATCH] add test for impl_get_path_by_opt and impl_get_opt_by_path --- test/test_config.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test_config.py b/test/test_config.py index 98f2095..4e38f19 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -143,6 +143,24 @@ def test_information_config(): assert config.impl_get_information('info') == string +def test_config_impl_get_path_by_opt(): + descr = make_description() + config = Config(descr) + dummy = config.unwrap_from_path('gc.dummy') + boo = config.unwrap_from_path('bool') + assert config.cfgimpl_get_description().impl_get_path_by_opt(boo) == 'bool' + assert config.cfgimpl_get_description().impl_get_path_by_opt(dummy) == 'gc.dummy' + + +def test_config_impl_get_opt_by_path(): + descr = make_description() + config = Config(descr) + dummy = config.unwrap_from_path('gc.dummy') + boo = config.unwrap_from_path('bool') + assert config.cfgimpl_get_description().impl_get_opt_by_path('bool') == boo + assert config.cfgimpl_get_description().impl_get_opt_by_path('gc.dummy') == dummy + + def test_information_display(): g1 = IntOption('g1', '', 1) g2 = StrOption('g2', '', 'héhé')