diff options
| author | David Bremner <david@tethera.net> | 2022-04-30 14:26:55 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2022-04-30 14:26:55 -0300 |
| commit | 97b6a43d46be19b73c2848b29184a93db06ddfe8 (patch) | |
| tree | 1618e07c4b2c3514946d01dc83e92524a95aae18 /bindings/python-cffi/tests | |
| parent | 4a4ea3234e6bd056aaa4b826765c089e8c884882 (diff) | |
| parent | a9b5f8959a20bbce774dec8a65a8b207555e52bd (diff) | |
Merge tag 'debian/0.36-1' into debian/bullseye-backports
notmuch release 0.36-1 for unstable (sid) [dgit]
[dgit distro=debian no-split --quilt=linear]
Diffstat (limited to 'bindings/python-cffi/tests')
| -rw-r--r-- | bindings/python-cffi/tests/test_config.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/bindings/python-cffi/tests/test_config.py b/bindings/python-cffi/tests/test_config.py index 67b0dea4..2a7f42f0 100644 --- a/bindings/python-cffi/tests/test_config.py +++ b/bindings/python-cffi/tests/test_config.py @@ -34,20 +34,24 @@ class TestIter: print(repr(val)) def test_iter(self, db): - assert list(db.config) == [] - db.config['spam'] = 'ham' - db.config['eggs'] = 'bacon' - assert set(db.config) == {'spam', 'eggs'} - assert set(db.config.keys()) == {'spam', 'eggs'} - assert set(db.config.values()) == {'ham', 'bacon'} - assert set(db.config.items()) == {('spam', 'ham'), ('eggs', 'bacon')} + def has_prefix(x): + return x.startswith('TEST.') + + assert [ x for x in db.config if has_prefix(x) ] == [] + db.config['TEST.spam'] = 'TEST.ham' + db.config['TEST.eggs'] = 'TEST.bacon' + assert { x for x in db.config if has_prefix(x) } == {'TEST.spam', 'TEST.eggs'} + assert { x for x in db.config.keys() if has_prefix(x) } == {'TEST.spam', 'TEST.eggs'} + assert { x for x in db.config.values() if has_prefix(x) } == {'TEST.ham', 'TEST.bacon'} + assert { (x, y) for (x,y) in db.config.items() if has_prefix(x) } == \ + {('TEST.spam', 'TEST.ham'), ('TEST.eggs', 'TEST.bacon')} def test_len(self, db): - assert len(db.config) == 0 + defaults = len(db.config) db.config['spam'] = 'ham' - assert len(db.config) == 1 + assert len(db.config) == defaults + 1 db.config['eggs'] = 'bacon' - assert len(db.config) == 2 + assert len(db.config) == defaults + 2 def test_del(self, db): db.config['spam'] = 'ham' |
