The Charm Tech team has just released version 2.6.0 of ops
.
In addition to smaller fixes and features, there are two significant new features in testing.Harness
:
- Add
Harness.handle_exec
to allow charm tests to simulateContainer.exec
calls (Pebble one-shot commands) and provide expected output. Thanks @weii-wang 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.
It’s available from PyPI by using pip install ops
, which should pick up the latest version (pin with ops==2.6.0
if you want to pin to a specific version).