Skip to content

Commit

Permalink
Restore test removed by mistake.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Sep 18, 2024
1 parent 97501fd commit 7be495f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_e2e/test_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,19 @@ def test_relation_ids():
assert rel.id == initial_id + i


def test_broken_relation_not_in_model_relations(mycharm):
rel = Relation("foo")

ctx = Context(
mycharm, meta={"name": "local", "requires": {"foo": {"interface": "foo"}}}
)
with ctx(ctx.on.relation_broken(rel), state=State(relations={rel})) as mgr:
charm = mgr.charm

assert charm.model.get_relation("foo") is None
assert charm.model.relations["foo"] == []


def test_get_relation_when_missing():
class MyCharm(CharmBase):
def __init__(self, framework):
Expand Down

0 comments on commit 7be495f

Please sign in to comment.