| 835 | cf.popitem() |
| 836 | |
| 837 | def test_clear(self): |
| 838 | cf = self.newconfig({"foo": "Bar"}) |
| 839 | self.assertEqual( |
| 840 | cf.get(self.default_section, "Foo"), "Bar", |
| 841 | "could not locate option, expecting case-insensitive option names") |
| 842 | cf['zing'] = {'option1': 'value1', 'option2': 'value2'} |
| 843 | self.assertEqual(cf.sections(), ['zing']) |
| 844 | self.assertEqual(set(cf['zing'].keys()), {'option1', 'option2', 'foo'}) |
| 845 | cf.clear() |
| 846 | self.assertEqual(set(cf.sections()), set()) |
| 847 | self.assertEqual(set(cf[self.default_section].keys()), {'foo'}) |
| 848 | |
| 849 | def test_setitem(self): |
| 850 | cf = self.fromstring(""" |