[PATCH 6/6] Added a validation test for the GUI group list
Vratislav Podzimek
vpodzime at redhat.com
Fri Aug 23 09:27:40 UTC 2013
On Thu, 2013-08-22 at 17:54 -0400, David Shea wrote:
> ---
> pyanaconda/regexes.py | 16 +++++
> pyanaconda/ui/gui/__init__.py | 87 ++++++++++++++++++++++++++++
> pyanaconda/ui/gui/spokes/advanced_user.glade | 24 ++++++--
> pyanaconda/ui/gui/spokes/user.py | 33 +++++++++--
> tests/regex_tests/groupparse_test.py | 61 +++++++++++++++++++
> 5 files changed, 211 insertions(+), 10 deletions(-)
> create mode 100755 tests/regex_tests/groupparse_test.py
>
> + @staticmethod
> + def _validateGroups(editable, data):
> + groups_list = editable.get_text().split(",")
> +
> + # Check each group name in the list
> + for group in groups_list:
> + group_name = GROUPLIST_FANCY_PARSE.match(group).group('name')
> + if not GROUPNAME_VALID.match(group_name):
> + return _("Invalid group name: %s") % group_name
> +
> + return None
This could be a standard function instead of a staticmethod.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list