(self)
| 101 | return config.IdleUserConfParser(path) |
| 102 | |
| 103 | def test_set_option(self): |
| 104 | parser = self.new_parser() |
| 105 | parser.add_section('Foo') |
| 106 | # Setting new option in existing section should return True. |
| 107 | self.assertTrue(parser.SetOption('Foo', 'bar', 'true')) |
| 108 | # Setting existing option with same value should return False. |
| 109 | self.assertFalse(parser.SetOption('Foo', 'bar', 'true')) |
| 110 | # Setting exiting option with new value should return True. |
| 111 | self.assertTrue(parser.SetOption('Foo', 'bar', 'false')) |
| 112 | self.assertEqual(parser.Get('Foo', 'bar'), 'false') |
| 113 | |
| 114 | # Setting option in new section should create section and return True. |
| 115 | self.assertTrue(parser.SetOption('Bar', 'bar', 'true')) |
| 116 | self.assertCountEqual(parser.sections(), ['Bar', 'Foo']) |
| 117 | self.assertEqual(parser.Get('Bar', 'bar'), 'true') |
| 118 | |
| 119 | def test_remove_option(self): |
| 120 | parser = self.new_parser() |
nothing calls this directly
no test coverage detected