FAQ | This is a LIVE service | Changelog

Skip to content

Capabilities comparison

Robin Goodall requested to merge capabilities-comparison into master

While adding this functionality, took the opportunity to do some long outstanding tidy-up. Probably best to review commit at a time.

Gets rid of lots of repeating of the code:

if state.get('thing') is None:
   func_that_sets_thing()
thing = state.get('thing')  # i.e. now get it again and do something with it

Adds support for state.get to take a callable as default and if so, call it then retry getting the state. You can then replace the above with:

thing = state.get('thing', func_that_sets_thing)

As I decreased coverage with the extra code, I did a quick pass and improving it with some extra tests, specifically around invalid API responses. Part of #21

Closes: #17 (closed)

Merge request reports