Add Juju context to _OSTestingModelBackend
ops 2.16.0 expects _JujuContext to the TestingModelBackend class. So update the derived class initiation accordingly. Change-Id: If5b709762e336c64ab511a450a1a1cc8bdd4e662
This commit is contained in:
parent
7f87cc9a6c
commit
41fc880836
@ -51,6 +51,9 @@ from ops import (
|
||||
framework,
|
||||
model,
|
||||
)
|
||||
from ops.jujucontext import (
|
||||
_JujuContext,
|
||||
)
|
||||
from ops.testing import (
|
||||
Harness,
|
||||
_TestingModelBackend,
|
||||
@ -800,7 +803,10 @@ def get_harness(
|
||||
actions=charm_actions,
|
||||
)
|
||||
harness._backend = _OSTestingModelBackend(
|
||||
harness._unit_name, harness._meta, harness._get_config(charm_config)
|
||||
harness._unit_name,
|
||||
harness._meta,
|
||||
harness._get_config(charm_config),
|
||||
_JujuContext.from_dict(os.environ),
|
||||
)
|
||||
harness._model = model.Model(harness._meta, harness._backend) # type: ignore
|
||||
harness._framework = framework.Framework(
|
||||
|
Loading…
x
Reference in New Issue
Block a user