added comments

This commit is contained in:
Andreas Preikschat 2013-05-12 14:04:15 +02:00
parent 75c8382188
commit d03a9a8eec

View File

@ -32,14 +32,24 @@ class TestSettings(TestCase):
def extend_default_settings_test(self):
"""
Test the static extend_default_settings() method.
Test the static extend_default_settings() method
"""
# GIVEN:
# WHEN: Try to access not existing setting.
with self.assertRaises(KeyError) as context:
Settings().value(u'core/does not exist')
# THEN: An exception should be raised.
self.assertEqual(context.exception[0], u'core/does not exist')
# GIVEN: Extended setting.
Settings.extend_default_settings({u'core/does exist': True})
# WHEN: Try to access it.
value = Settings().value(u'core/does exist')
# THEN: The correct value should be returned.
assert value and isinstance(value, bool)