forked from openlp/openlp
added comments
This commit is contained in:
parent
75c8382188
commit
d03a9a8eec
@ -32,14 +32,24 @@ class TestSettings(TestCase):
|
|||||||
|
|
||||||
def extend_default_settings_test(self):
|
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:
|
with self.assertRaises(KeyError) as context:
|
||||||
Settings().value(u'core/does not exist')
|
Settings().value(u'core/does not exist')
|
||||||
|
|
||||||
|
# THEN: An exception should be raised.
|
||||||
self.assertEqual(context.exception[0], u'core/does not exist')
|
self.assertEqual(context.exception[0], u'core/does not exist')
|
||||||
|
|
||||||
|
# GIVEN: Extended setting.
|
||||||
Settings.extend_default_settings({u'core/does exist': True})
|
Settings.extend_default_settings({u'core/does exist': True})
|
||||||
|
|
||||||
|
# WHEN: Try to access it.
|
||||||
value = Settings().value(u'core/does exist')
|
value = Settings().value(u'core/does exist')
|
||||||
|
|
||||||
|
# THEN: The correct value should be returned.
|
||||||
assert value and isinstance(value, bool)
|
assert value and isinstance(value, bool)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user