Merge ~mthaddon/charm-k8s-mattermost/+git/charm-k8s-mattermost:license_secret_test into charm-k8s-mattermost:master

Proposed by Tom Haddon
Status: Merged
Approved by: Tom Haddon
Approved revision: 70bdf2eedfa79527f2d0ffef60a6471d03f75027
Merged at revision: 87dc53420879d4401d94acf8be54e64a85fee1e5
Proposed branch: ~mthaddon/charm-k8s-mattermost/+git/charm-k8s-mattermost:license_secret_test
Merge into: charm-k8s-mattermost:master
Diff against target: 22 lines (+7/-0)
1 file modified
tests/unit/test_charm.py (+7/-0)
Reviewer Review Type Date Requested Status
Paul Collins Approve
Canonical IS Reviewers Pending
Review via email: mp+385375@code.launchpad.net

Commit message

Add a test for getting the licence secret name

Description of the change

Add a test for getting the licence secret name

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Paul Collins (pjdc) :
review: Approve
Revision history for this message
Paul Collins (pjdc) wrote :

I assume your commit email is not intentional -- leaving for you to top-approve once updated.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 87dc53420879d4401d94acf8be54e64a85fee1e5

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py
2index 7e8c809..13b47f1 100644
3--- a/tests/unit/test_charm.py
4+++ b/tests/unit/test_charm.py
5@@ -41,6 +41,8 @@ CONFIG_IMAGE_NO_PASSWORD = {
6 'sso': False,
7 }
8
9+CONFIG_LICENCE_SECRET = {"licence": "RANDOMSTRING"}
10+
11 CONFIG_NO_S3_SETTINGS_S3_ENABLED = {
12 'clustering': False,
13 'mattermost_image_path': 'example.com/mattermost:latest',
14@@ -119,3 +121,8 @@ class TestMattermostK8sCharm(unittest.TestCase):
15 """Any CIDRs that has host bits set must be rejected, even if others are OK."""
16 expected = 'range_mixed: invalid network(s): 10.242.0.0/8'
17 self.assertEqual(check_ranges(RANGE_MIXED, 'range_mixed'), expected)
18+
19+ def test_get_licence_secret_name(self):
20+ """Test the licence secret name is correctly constructed"""
21+ self.harness.charm.model.config = copy.deepcopy(CONFIG_LICENCE_SECRET)
22+ self.assertEqual(self.harness.charm._get_licence_secret_name(), "mattermost-licence-b5bbb1bf")

Subscribers

People subscribed via source and target branches