def test_plugin_callback(self):
        class DummyPlugin(plugins.BeetsPlugin):
            def __init__(self):
                super(DummyPlugin, self).__init__()
                self.register_listener('before_choose_candidate',
                                       self.return_choices)

            def return_choices(self, session, task):
                return [ui.commands.PromptChoice('f', u'Foo', self.foo)]

            def foo(self, session, task):
                pass

        self.register_plugin(DummyPlugin)
        # Default options + extra choices by the plugin ('Foo', 'Bar')
        opts = (u'Apply', u'More candidates', u'Skip', u'Use as-is',
                u'as Tracks', u'Group albums', u'Enter search',
                u'enter Id', u'aBort') + (u'Foo',)

        # DummyPlugin.foo() should be called once
        with patch.object(DummyPlugin, 'foo', autospec=True) as mock_foo:
            with helper.control_stdin('\n'.join(['f', 's'])):
                self.importer.run()
            self.assertEqual(mock_foo.call_count, 1)

        # input_options should be called twice, as foo() returns None
        self.assertEqual(self.mock_input_options.call_count, 2)
        self.mock_input_options.assert_called_with(opts, default='a',
                                                   require=ANY)
Calls the SOAP method overriding client settings.
dataset/ETHPy150Open beetbox/beets/test/test_plugins.py/PromptChoicesTest.test_plugin_callback--crossover with--dataset/ETHPy150Open ombre42/robotframework-sudslibrary/src/SudsLibrary/proxy.py/_ProxyKeywords.specific_soap_call