Skip to content

Commit

Permalink
Revert "Remove broken test for notmuch config parsing"
Browse files Browse the repository at this point in the history
This reverts commit 1359aba.
  • Loading branch information
lucc committed May 6, 2024
1 parent e0e0786 commit fffb427
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/settings/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from unittest import mock

from alot.settings.manager import SettingsManager
from alot.settings.errors import NoMatchingAccount
from alot.settings.errors import ConfigError, NoMatchingAccount

from .. import utilities

Expand All @@ -32,6 +32,18 @@ def test_reading_synchronize_flags_from_notmuch_config(self):
actual = manager.get_notmuch_setting('maildir', 'synchronize_flags')
self.assertTrue(actual)

def test_parsing_notmuch_config_with_non_bool_synchronize_flag_fails(self):
with tempfile.NamedTemporaryFile(mode='w+', delete=False) as f:
f.write(textwrap.dedent("""\
[maildir]
synchronize_flags = not bool
"""))
self.addCleanup(os.unlink, f.name)

with self.assertRaises(ConfigError):
manager = SettingsManager()
manager.read_notmuch_config(f.name)

def test_reload_notmuch_config(self):
with tempfile.NamedTemporaryFile(mode='w+', delete=False) as f:
f.write(textwrap.dedent("""\
Expand Down

0 comments on commit fffb427

Please sign in to comment.