operator icon indicating copy to clipboard operation
operator copied to clipboard

Make sure that immutability in unit testing (Scenario) is documented

Open dwilding opened this issue 11 months ago • 2 comments

Per https://github.com/canonical/operator/issues/1671, we should make sure the docs are clear about:

  • Objects should be treated as immutable
  • How to create adjusted objects during a unit test (see Tony's comment for examples)
  • Why you might want to run more than one event as part of the same unit test, along with mutability considerations (referring back to the above two points)

dwilding avatar Apr 11 '25 03:04 dwilding

@dwilding Want to take this on as Friday item? Seems small but probably still worth doing.

benhoyt avatar Sep 09 '25 02:09 benhoyt

Sounds good. My usual process for Friday is to chip away at the ones labelled docs, so that works 🙂

dwilding avatar Sep 09 '25 02:09 dwilding