From 8b4d03095f5b50ec72031c48b15b009cbf300376 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 20 Jul 2019 16:19:09 -0400 Subject: [PATCH] parentwork tests: Remove unnecessary mocking This mocking doesn't do anything because `command_output` is never invoked by the code under test. See also #3332. --- test/test_parentwork.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/test/test_parentwork.py b/test/test_parentwork.py index dfebc6602..aa25c7f51 100644 --- a/test/test_parentwork.py +++ b/test/test_parentwork.py @@ -17,7 +17,6 @@ from __future__ import division, absolute_import, print_function -from mock import patch import unittest from test.helper import TestHelper @@ -25,7 +24,6 @@ from beets.library import Item from beetsplug import parentwork -@patch('beets.util.command_output') class ParentWorkTest(unittest.TestCase, TestHelper): def setUp(self): """Set up configuration""" @@ -36,39 +34,36 @@ class ParentWorkTest(unittest.TestCase, TestHelper): self.unload_plugins() self.teardown_beets() - def test_normal_case(self, command_output): + def test_normal_case(self): item = Item(path='/file', mb_workid=u'e27bda6e-531e-36d3-9cd7-b8ebc18e8c53') item.add(self.lib) - command_output.return_value = u'32c8943f-1b27-3a23-8660-4567f4847c94' self.run_command('parentwork') item.load() self.assertEqual(item['mb_parentworkid'], u'32c8943f-1b27-3a23-8660-4567f4847c94') - def test_force(self, command_output): + def test_force(self): self.config['parentwork']['force'] = True item = Item(path='/file', mb_workid=u'e27bda6e-531e-36d3-9cd7-b8ebc18e8c53', mb_parentworkid=u'XXX') item.add(self.lib) - command_output.return_value = u'32c8943f-1b27-3a23-8660-4567f4847c94' self.run_command('parentwork') item.load() self.assertEqual(item['mb_parentworkid'], u'32c8943f-1b27-3a23-8660-4567f4847c94') - def test_no_force(self, command_output): + def test_no_force(self): self.config['parentwork']['force'] = True item = Item(path='/file', mb_workid=u'e27bda6e-531e-36d3-9cd7-\ b8ebc18e8c53', mb_parentworkid=u'XXX') item.add(self.lib) - command_output.return_value = u'32c8943f-1b27-3a23-8660-4567f4847c94' self.run_command('parentwork') item.load() @@ -77,7 +72,7 @@ class ParentWorkTest(unittest.TestCase, TestHelper): # test different cases, still with Matthew Passion Ouverture or Mozart # requiem - def test_direct_parent_work(self, command_output): + def test_direct_parent_work(self): mb_workid = u'2e4a3668-458d-3b2a-8be2-0b08e0d8243a' self.assertEqual(u'f04b42df-7251-4d86-a5ee-67cfa49580d1', parentwork.direct_parent_id(mb_workid)[0])