Fix config option setting in unit tests

Since https://github.com/canonical/operator/pull/635
harness.update_config()'s behavior has changed and
validates that the config options being set do exist
on the charm.

Change-Id: I2fee2ecb61bf51e7412de74cf1b030114ec3b8dd
This commit is contained in:
Aurelien Lourot 2021-11-25 15:16:35 +01:00
parent 2057e90e46
commit eb21629e5f
1 changed files with 23 additions and 0 deletions

View File

@ -124,6 +124,29 @@ class TestOSBaseCharm(CharmTestCase):
description: pause action
resume:
description: resume action
''',
config='''
options:
source:
type: string
default:
description: a PPA
key:
type: string
default:
description: a key
custom-check-fail:
type: bool
default: False
description: a failure to report in the unit status
plugin1-check-fail:
type: bool
default: False
description: another failure to report
plugin2-check-fail:
type: bool
default: False
description: yet another failure to report
''')
def test_init(self):