From 5e5660a850a01f2b3d37b0067f6f86d98f45933e Mon Sep 17 00:00:00 2001 From: Pietro Pasotti Date: Fri, 24 Jun 2022 14:58:48 +0200 Subject: [PATCH] fixed --- ops/testing.py | 4 ++-- test/test_testing.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ops/testing.py b/ops/testing.py index d57652a9c..94b238ae9 100755 --- a/ops/testing.py +++ b/ops/testing.py @@ -47,7 +47,6 @@ from io import BytesIO, StringIO from textwrap import dedent -import ops.model from ops import charm, framework, model, pebble, storage from ops._private import yaml @@ -650,7 +649,8 @@ def add_relation_unit(self, relation_id: int, remote_unit_name: str) -> None: None """ self._backend._relation_list_map[relation_id].append(remote_unit_name) - self._backend._relation_data[relation_id][remote_unit_name] = {} + rel_data = self._backend._relation_data + rel_data[relation_id][remote_unit_name] = _TestingRelationDataContents() # TODO: jam 2020-08-03 This is where we could assert that the unit name matches the # application name (eg you don't have a relation to 'foo' but add units of 'bar/0' self._backend._relation_app_and_units[relation_id]["units"].append(remote_unit_name) diff --git a/test/test_testing.py b/test/test_testing.py index 90be8b1f1..3028b5454 100644 --- a/test/test_testing.py +++ b/test/test_testing.py @@ -30,7 +30,7 @@ import yaml import ops.testing -from ops import pebble, model +from ops import model, pebble from ops.charm import ( CharmBase, PebbleReadyEvent,