From d4ccc106676331ca5a603273cf86158d0fc5112d Mon Sep 17 00:00:00 2001 From: Jesse Weinstein Date: Wed, 6 Jan 2016 00:27:55 -0800 Subject: [PATCH 1/2] Fix typo: judment -> judgement --- beets/ui/commands.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 25ed0425d..72c345c68 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -440,7 +440,7 @@ def summarize_items(items, singleton): return ', '.join(summary_parts) -def _summary_judment(rec): +def _summary_judgment(rec): """Determines whether a decision should be made without even asking the user. This occurs in quiet mode and when an action is chosen for NONE recommendations. Return an action or None if the user should be @@ -697,7 +697,7 @@ class TerminalImportSession(importer.ImportSession): u' ({0} items)'.format(len(task.items))) # Take immediate action if appropriate. - action = _summary_judment(task.rec) + action = _summary_judgment(task.rec) if action == importer.action.APPLY: match = task.candidates[0] show_change(task.cur_artist, task.cur_album, match) @@ -757,7 +757,7 @@ class TerminalImportSession(importer.ImportSession): candidates, rec = task.candidates, task.rec # Take immediate action if appropriate. - action = _summary_judment(task.rec) + action = _summary_judgment(task.rec) if action == importer.action.APPLY: match = candidates[0] show_item_change(task.item, match) From 7370cdfd39e0f4669b11247e5a3dbbe449bdfb36 Mon Sep 17 00:00:00 2001 From: Jesse Weinstein Date: Wed, 6 Jan 2016 01:34:52 -0800 Subject: [PATCH 2/2] Add test for backwards compat --- test/test_play.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test_play.py b/test/test_play.py index 2c2c076de..d0371cf15 100644 --- a/test/test_play.py +++ b/test/test_play.py @@ -105,6 +105,15 @@ class PlayPluginTest(unittest.TestCase, TestHelper): self.open_mock.assert_not_called() + def test_warning_threshold_backwards_compat(self): + self.config['play']['warning_treshold'] = 1 + self.add_item(title='another NiceTitle') + + with control_stdin("a"): + self.run_command('play', 'nice') + + self.open_mock.assert_not_called() + def test_command_failed(self): self.open_mock.side_effect = OSError("some reason")