2.6.0: Harness.handle_exec, Harness.add_relation improvements, and more
This release has two significant improvements to testing.Harness
:
- Add
Harness.handle_exec
to allow charm tests to simulateContainer.exec
calls (Pebble one-shot commands) and provide expected output. Thanks @weiiwang01 for the design and implementation (PR 993). - Simplify adding relation units and relation data by adding
app_data
andunit_data
parameters toHarness.add_relation
. Previously, charm tests would have to calladd_relation
followed byadd_relation_unit
andupdate_relation_data
-- now only a singleadd_relation
call is required. Implemented in PR 994.
In addition, several small improvements and fixes are included:
- feat(model): add
Secret.unique_identifier
(XID part); improve id/label docs in #986 - fix(testing): ignore
push()
encoding if source is a binary file or stream in #991 - fix(pebble): remove use of deprecated
cgi
module in Pebble code in #996 - fix(model): ensure Secret.get_content returns a copy of the dict in #1000
- fix(model): make Secret.set_content invalidate local cache by in #1001