Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: support comma in config ListAttribute item
This is a first step towards completing sopel-irc#1455, since, as @dgw mentioned, to do so would require accepting commas in a single entry of `ListAttribute`. Items entered through the wizard do not need to be escaped manually. Items configured in the `.cfg` file manually require an escaped command, like `\,`. The prompt has also been changed such that the items are now surrounded by quotes so that one can differentiate items that may contains commas. The following scenarios were tested (using the `url.py` module, specifically the `exclude` setting): 1. Wizard, setting items when there is no default (preexisting items); mix of w/ commas and w/o commas 2. Wizard, replacing existing items when a default exists; mix of w/ commas and w/o commas 3. Wizard, extending the current default list; mix of w/ commas and w/o commas 4. Manual edit, setting items; w/ commas (manually escaped) and w/o commas 5. Wizard, setting items w/o default; no commas Relevant tests have also been updated/added: 1. Item with comma remains single item: - `test_listattribute_with_value_containing_comma` 2. Item with backslash is correctly serialized/parsed: - `test_listattribute_with_value_containing_backslash` - `test_listattribute_with_value_ending_in_backslash`
- Loading branch information