Harness Extensions
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/beta | 3 | 05 Jul 2022 |
juju deploy harness-extensions --channel beta
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
charms.harness_extensions.v0.capture_events
-
- Last updated 24 Jun 2022
- Revision Library version 0.3
This is a library providing a utility for unittesting events fired on a Harness-ed Charm.
Example usage:
from charms.harness_extensions.v0.capture_events import capture with capture(RelationEvent) as captured: harness.add_relation('foo', 'remote') assert captured.event.unit.name == 'remote'
Index
def capture_events(charm: CharmBase)
Description
Capture all events of type *types
(using instance checks). None
Methods
class Captured
Description
Object to type and expose return value of capture(). None
Methods
Captured. event( self )
Description
Return the captured event. None
Captured. event( self , val: _T )
def
capture(
charm: CharmBase,
typ_
)
Capture exactly 1 event of type typ_
.
Description
Will raise if more/less events have been fired, or if the returned event does not pass an instance check.