add test for impl_get_path_by_opt and impl_get_opt_by_path

This commit is contained in:
Emmanuel Garette 2013-08-29 09:29:28 +02:00
parent 8aa4260404
commit eb62d0c4a4
1 changed files with 18 additions and 0 deletions

View File

@ -143,6 +143,24 @@ def test_information_config():
assert config.impl_get_information('info') == string 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(): def test_information_display():
g1 = IntOption('g1', '', 1) g1 = IntOption('g1', '', 1)
g2 = StrOption('g2', '', 'héhé') g2 = StrOption('g2', '', 'héhé')