From 18e74643a6979ca4e490d34975a38c83a1722417 Mon Sep 17 00:00:00 2001 From: Martin Nagy Date: Mon, 20 Oct 2008 19:53:07 +0200 Subject: Add comments in config.py and fix Environment.get() --- tests/test_ipalib/test_config.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/test_ipalib/test_config.py') diff --git a/tests/test_ipalib/test_config.py b/tests/test_ipalib/test_config.py index df830232..ed982a73 100644 --- a/tests/test_ipalib/test_config.py +++ b/tests/test_ipalib/test_config.py @@ -93,7 +93,12 @@ def test_Environment(): # Test __setattr__() env.spam = 'ham' + assert env.spam == 'ham' + assert env['spam'] == 'ham' + assert env.get('spam') == 'ham' + assert env.get('nonexistent') == None + assert env.get('nonexistent', 42) == 42 # Test if we throw AttributeError exception when trying to overwrite # existing value, or delete it -- cgit