Skip to content

Commit

Permalink
steno_dictionary: don't allow clear on a read-only dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-pierre committed Apr 29, 2021
1 parent 3e7fae6 commit 03c4915
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions plover/steno_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def __getitem__(self, key):
return self._dict.__getitem__(key)

def clear(self):
assert not self.readonly
self._dict.clear()
self.reverse.clear()
self.casereverse.clear()
Expand Down
1 change: 1 addition & 0 deletions plover_build_utils/testing/steno_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def fake_asset_only(p, r, v=None):
@pytest.mark.parametrize('method_name, args', (
('__delitem__', (VALID_KEY,)),
('__setitem__', (VALID_KEY, 'pouet!')),
('clear' , ()),
('save' , ()),
('update' , ()),
))
Expand Down

0 comments on commit 03c4915

Please sign in to comment.