Create a new section in the configuration. Raise DuplicateSectionError if a section by the specified name already exists. Raise ValueError if name is DEFAULT.
(self, section)
| 699 | return list(self._sections.keys()) |
| 700 | |
| 701 | def add_section(self, section): |
| 702 | """Create a new section in the configuration. |
| 703 | |
| 704 | Raise DuplicateSectionError if a section by the specified name |
| 705 | already exists. Raise ValueError if name is DEFAULT. |
| 706 | """ |
| 707 | if section == self.default_section: |
| 708 | raise ValueError('Invalid section name: %r' % section) |
| 709 | |
| 710 | if section is UNNAMED_SECTION: |
| 711 | if not self._allow_unnamed_section: |
| 712 | raise UnnamedSectionDisabledError |
| 713 | |
| 714 | if section in self._sections: |
| 715 | raise DuplicateSectionError(section) |
| 716 | self._sections[section] = self._dict() |
| 717 | self._proxies[section] = SectionProxy(self, section) |
| 718 | |
| 719 | def has_section(self, section): |
| 720 | """Indicate whether the named section is present in the configuration. |
no test coverage detected