canonical / ops-scenario

State-transition testing SDK for Operator Framework Juju charms.
Apache License 2.0
10 stars 7 forks source link

Use ops.jujucontext._JujuContext #179

Open tonyandrewmeyer opened 2 weeks ago

tonyandrewmeyer commented 2 weeks ago

We should be able to simplify some of the code by using the new ops.jujucontext._JujuContext class to manage mocking the environment variables that normally come from Juju.

There's some compatibility code added in #178 that can be cleaned out and replaced by requiring the newer version of ops and making proper use of a _JujuContext object.

Maybe we want to do this and #125 together, or do that one first and then this one?

Relevant ops PR: https://github.com/canonical/operator/pull/1313