main: Add ConfigError test.

This commit is contained in:
Thomas Adamcik 2013-04-01 21:35:01 +02:00
parent 5e608c18dc
commit 5283d1e2b2

View File

@ -23,3 +23,13 @@ class ExceptionsTest(unittest.TestCase):
def test_extension_error_is_a_mopidy_exception(self):
self.assert_(issubclass(
exceptions.ExtensionError, exceptions.MopidyException))
def test_config_error_is_a_mopidy_exception(self):
self.assert_(issubclass(
exceptions.ConfigError, exceptions.MopidyException))
def test_config_error_provides_getitem(self):
exception = exceptions.ConfigError({'field1': 'msg1', 'field2': 'msg2'})
self.assertEqual('msg1', exception['field1'])
self.assertEqual('msg2', exception['field2'])
self.assertItemsEqual(['field1', 'field2'], exception)