def test_plugin_choices_in_ui_input_options_singleton(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', None),
                        ui.commands.PromptChoice('r', u'baR', None)]

        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'Enter search',
                u'enter Id', u'aBort') + (u'Foo', u'baR')

        config['import']['singletons'] = True
        self.importer.add_choice(action.SKIP)
        self.importer.run()
        self.mock_input_options.assert_called_with(opts, default='a',
                                                   require=ANY)
L{KnownHostsFile.save()} will write out a new file with any entries
dataset/ETHPy150Open beetbox/beets/test/test_plugins.py/PromptChoicesTest.test_plugin_choices_in_ui_input_options_singleton--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/conch/test/test_knownhosts.py/KnownHostsDatabaseTests.test_savingAddsEntry