def test_DConf_get_bool__true(): obj = DConf( get_config(''' [section] test_a=True test_b=true test_c=Yes test_d=yes ''')) assert obj.get_bool('section', 'test_a') assert obj.get_bool('section', 'test_b') assert obj.get_bool('section', 'test_c') assert obj.get_bool('section', 'test_d')
def test_DConf_get_bool__false(): obj = DConf( get_config(''' [section] test_a=False test_b=false test_c=No test_d=no ''')) assert not obj.get_bool('section', 'test_a') assert not obj.get_bool('section', 'test_b') assert not obj.get_bool('section', 'test_c') assert not obj.get_bool('section', 'test_d')
def test_DConf_get_bool__non_existent(): obj = DConf('') assert not obj.get_bool('section', 'non-existent-option')