Skip to content

Commit

Permalink
Fixup unit test container connection
Browse files Browse the repository at this point in the history
  • Loading branch information
javacruft committed May 1, 2023
1 parent c016c3f commit 78ff54c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def test_action(self):

def test_rabbitmq_pebble_ready(self):
"""Test pebble handler."""
# Get the rabbitmq container from the model
container = self.harness.model.unit.get_container("rabbitmq")
self.harness.set_can_connect(container, True)
# self.harness.charm._render_and_push_config_files = Mock()
# self.harness.charm._render_and_push_plugins = Mock()
# Check the initial Pebble plan is empty
Expand Down Expand Up @@ -88,8 +91,6 @@ def test_rabbitmq_pebble_ready(self):
},
},
}
# Get the rabbitmq container from the model
container = self.harness.model.unit.get_container("rabbitmq")
# RabbitMQ is up, operator user initialized
peers_relation_id = self.harness.add_relation("peers", "rabbitmq-k8s")
self.harness.add_relation_unit(peers_relation_id, "rabbitmq-k8s/0")
Expand Down

0 comments on commit 78ff54c

Please sign in to comment.