Commit Graph

4 Commits

Author SHA1 Message Date
Dan Bungert 34d40643ad format with black + isort 2023-07-25 15:27:42 -06:00
Olivier Gayot 4025cbf97f ui: avoid crashing when removing overlay that does not exist
BaseView.remove_overlay() would crash with AttributeError if no overlay
was found. We now add a not_found_ok parameter (defaulting to True) that
makes the function silently return if the overlay could not be found.

Passing not_found_ok=False and catching OverlayNotFoundError can be
helpful in some scenarios to do something different if no overlay was
found.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-12-07 10:31:05 +01:00
Dan Bungert 0308fa49b1 core test_view: don't prefix local class w/ Test
Fix warning:
  subiquitycore/tests/test_view.py:24
    subiquity/subiquitycore/tests/test_view.py:24:
    PytestCollectionWarning: cannot collect test class 'TestStretchy'
    because it has a __init__ constructor
2021-10-15 16:12:44 -06:00
Michael Hudson-Doyle 5dc2895481 add the ability to remove a particular overlay, not just the top one 2020-05-01 12:46:45 +12:00