do_test is not actually a test

This commit is contained in:
Jesse Weinstein 2016-07-24 22:45:31 -07:00
parent 92d008b155
commit 9df4b6dc15

View file

@ -41,8 +41,8 @@ class PlayPluginTest(unittest.TestCase, TestHelper):
self.teardown_beets()
self.unload_plugins()
def do_test(self, open_mock, args=('title:aNiceTitle',),
expected_cmd='echo', expected_playlist=None):
def run_and_assert(self, open_mock, args=('title:aNiceTitle',),
expected_cmd='echo', expected_playlist=None):
self.run_command('play', *args)
open_mock.assert_called_once_with(ANY, expected_cmd)
@ -52,20 +52,20 @@ class PlayPluginTest(unittest.TestCase, TestHelper):
self.assertEqual(exp_playlist, playlist.read().decode('utf-8'))
def test_basic(self, open_mock):
self.do_test(open_mock)
self.run_and_assert(open_mock)
def test_album_option(self, open_mock):
self.do_test(open_mock, [u'-a', u'nice'])
self.run_and_assert(open_mock, [u'-a', u'nice'])
def test_args_option(self, open_mock):
self.do_test(open_mock,
[u'-A', u'foo', u'title:aNiceTitle'], u'echo foo')
self.run_and_assert(
open_mock, [u'-A', u'foo', u'title:aNiceTitle'], u'echo foo')
def test_args_option_in_middle(self, open_mock):
self.config['play']['command'] = 'echo $args other'
self.do_test(open_mock,
[u'-A', u'foo', u'title:aNiceTitle'], u'echo foo other')
self.run_and_assert(
open_mock, [u'-A', u'foo', u'title:aNiceTitle'], u'echo foo other')
def test_relative_to(self, open_mock):
self.config['play']['command'] = 'echo'
@ -73,8 +73,8 @@ class PlayPluginTest(unittest.TestCase, TestHelper):
path = os.path.relpath(self.item.path, b'/something')
playlist = path.decode('utf8')
self.do_test(open_mock,
expected_cmd='echo', expected_playlist=playlist)
self.run_and_assert(
open_mock, expected_cmd='echo', expected_playlist=playlist)
def test_use_folders(self, open_mock):
self.config['play']['command'] = None