Skip to content

Commit

Permalink
Ensure that we're checking one of each type of option.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Apr 10, 2024
1 parent 507289a commit 2ceafad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion ops/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
Generator,
Iterable,
List,
Literal,
Mapping,
MutableMapping,
Optional,
Expand Down
9 changes: 8 additions & 1 deletion test/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def setUp(self):
type: int
qux:
type: boolean
baz:
type: float
secretfoo:
type: secret
''')
self.addCleanup(self.harness.cleanup)
self.relation_id_db0 = self.harness.add_relation('db0', 'db')
Expand Down Expand Up @@ -618,11 +622,14 @@ def test_relation_no_units(self):

def test_config(self):
self.harness._get_backend_calls(reset=True)
self.harness.update_config({'foo': 'foo', 'bar': 1, 'qux': True})
self.harness.update_config({'foo': 'foo', 'bar': 1, 'qux': True,
'baz': 3.1, 'secretfoo': 'secret:1234'})
self.assertEqual(self.model.config, {
'foo': 'foo',
'bar': 1,
'qux': True,
'baz': 3.1,
'secretfoo': 'secret:1234',
})
with self.assertRaises(TypeError):
# Confirm that we cannot modify config values.
Expand Down

0 comments on commit 2ceafad

Please sign in to comment.