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
diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py
index 7e8c809..13b47f1 100644
--- a/tests/unit/test_charm.py
+++ b/tests/unit/test_charm.py
@@ -41,6 +41,8 @@ CONFIG_IMAGE_NO_PASSWORD = {
41 'sso': False,41 'sso': False,
42}42}
4343
44CONFIG_LICENCE_SECRET = {"licence": "RANDOMSTRING"}
45
44CONFIG_NO_S3_SETTINGS_S3_ENABLED = {46CONFIG_NO_S3_SETTINGS_S3_ENABLED = {
45 'clustering': False,47 'clustering': False,
46 'mattermost_image_path': 'example.com/mattermost:latest',48 'mattermost_image_path': 'example.com/mattermost:latest',
@@ -119,3 +121,8 @@ class TestMattermostK8sCharm(unittest.TestCase):
119 """Any CIDRs that has host bits set must be rejected, even if others are OK."""121 """Any CIDRs that has host bits set must be rejected, even if others are OK."""
120 expected = 'range_mixed: invalid network(s): 10.242.0.0/8'122 expected = 'range_mixed: invalid network(s): 10.242.0.0/8'
121 self.assertEqual(check_ranges(RANGE_MIXED, 'range_mixed'), expected)123 self.assertEqual(check_ranges(RANGE_MIXED, 'range_mixed'), expected)
124
125 def test_get_licence_secret_name(self):
126 """Test the licence secret name is correctly constructed"""
127 self.harness.charm.model.config = copy.deepcopy(CONFIG_LICENCE_SECRET)
128 self.assertEqual(self.harness.charm._get_licence_secret_name(), "mattermost-licence-b5bbb1bf")

Subscribers

People subscribed via source and target branches