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_execto allow charm tests to simulateContainer.execcalls (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_dataandunit_dataparameters toHarness.add_relation. Previously, charm tests would have to calladd_relationfollowed byadd_relation_unitandupdate_relation_data– now only a singleadd_relationcall 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).