def _call(self, args):
    plugins = disco.PluginsRegistry.find_all()
    config = configuration.NamespaceConfig(cli.prepare_and_parse_args(plugins, args))
    with mock.patch('certbot._internal.cert_manager.get_certnames') as mock_certs:
        mock_certs.return_value = ['example.com']
        with mock.patch('certbot._internal.cert_manager.domains_for_certname') as mock_dom:
            mock_dom.return_value = ['example.com']
            with mock.patch('certbot._internal.main._init_le_client') as mock_init:
                mock_client = mock.MagicMock()
                mock_client.config = config
                mock_init.return_value = mock_client
                main.enhance(config, plugins)
                return mock_client
def _call(self, args):
    plugins = disco.PluginsRegistry.find_all()
    config = configuration.NamespaceConfig(cli.prepare_and_parse_args(plugins, args))
    with mock.patch('certbot._internal.cert_manager.get_certnames') as mock_certs:
        mock_certs.return_value = ['example.com']
        with mock.patch('certbot._internal.cert_manager.domains_for_certname') as mock_dom:
            mock_dom.return_value = ['example.com']
            with mock.patch('certbot._internal.main._init_le_client') as mock_init:
                mock_client = mock.MagicMock()
                mock_client.config = config
                mock_init.return_value = mock_client
                main.enhance(config, plugins)
                return mock_client