RedHatQE / RedHatQE/widgetastic.core
Smart is_displayed
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 37
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Description
Currently, we have is_displayed that only returns true or false without further explanation. It would be helpful to see which exact part of the is_displayed failed. Therefore I would propose this:
- Create a descriptor that will be set as
is_displayedinstead of the property and will hold a set of rules/checks for the displayed check. - The descriptor would implement
__nonzero__to act as a boolean value, therefore making it usable inifand such expressions. - On the
__nonzero__resolution it would store the result of each partial check in some sort of dictionary. - It would provide a method that would either directly raise an exception or just provide an information about those checks that did not pass.
if not view.is_displayed:
raise Exception(view.is_displayed.why)
Or something like that, this is just a concept. (the sample provided would have caching problems)
The rules would be flexible - a string could represent either widget name (it would call is_displayed on that one) or if it would not be a widget then it would assume it is an attribute to be read. It could also provide some basic checkers like you could do a value comparison ... the discussion is open.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing is_displayed implementation and reviewing how its current boolean result is used. Define the descriptor behavior, diagnostic information, rule format, and caching expectations before implementation; done means failed checks can be identified without breaking existing boolean-style usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100