(self)
| 51 | """ |
| 52 | |
| 53 | def test_get(self): |
| 54 | parser = config.IdleConfParser('') |
| 55 | parser.read_string(self.config) |
| 56 | eq = self.assertEqual |
| 57 | |
| 58 | # Test with type argument. |
| 59 | self.assertIs(parser.Get('one', 'one', type='bool'), False) |
| 60 | self.assertIs(parser.Get('one', 'two', type='bool'), True) |
| 61 | eq(parser.Get('one', 'three', type='int'), 10) |
| 62 | eq(parser.Get('two', 'one'), 'a string') |
| 63 | self.assertIs(parser.Get('two', 'two', type='bool'), True) |
| 64 | self.assertIs(parser.Get('two', 'three', type='bool'), False) |
| 65 | |
| 66 | # Test without type should fallback to string. |
| 67 | eq(parser.Get('two', 'two'), 'true') |
| 68 | eq(parser.Get('two', 'three'), 'false') |
| 69 | |
| 70 | # If option not exist, should return None, or default. |
| 71 | self.assertIsNone(parser.Get('not', 'exist')) |
| 72 | eq(parser.Get('not', 'exist', default='DEFAULT'), 'DEFAULT') |
| 73 | |
| 74 | def test_get_option_list(self): |
| 75 | parser = config.IdleConfParser('') |
nothing calls this directly
no test coverage detected