# Path: djangocodemirror/helper.py
# def codemirror_settings_update(configs, parameters, on=None, names=None):
#     """
#     Return a new dictionnary of configs updated with given parameters.
# 
#     You may use ``on`` and ``names`` arguments to select config or filter out
#     some configs from returned dict.
# 
#     Arguments:
#         configs (dict): Dictionnary of configurations to update.
#         parameters (dict): Dictionnary of parameters to apply on selected
#             configurations.
# 
#     Keyword Arguments:
#         on (list): List of configuration names to select for update. If empty,
#             all given configurations will be updated.
#         names (list): List of configuration names to keep. If not empty, only
#             those configurations will be in returned dict. Else every
#             configs from original dict will be present.
# 
#     Returns:
#         dict: Dict of configurations with updated parameters.
#     """
#     # Deep copy of given config
#     output = copy.deepcopy(configs)
# 
#     # Optionnaly filtering config from given names
#     if names:
#         output = {k: output[k] for k in names}
# 
#     # Select every config if selectors is empty
#     if not on:
#         on = output.keys()
# 
#     for k in on:
#         output[k].update(parameters)
# 
#     return output


import pytest
from djangocodemirror.helper import codemirror_settings_update
                'modes': ['rst'],
            },
            'basic': {
                'mode': 'rst',
                'foo': 'bar',
                'css_bundle_name': None,
                'lineWrapping': False,
                'modes': ['rst'],
            },
            'with-options': {
                'mode': 'rst',
                'foo': 'bar',
                'css_bundle_name': None,
                'lineWrapping': False,
                'modes': ['rst'],
            },
            'with-all': {
                'mode': 'rst',
                'foo': 'bar',
                'css_bundle_name': None,
                'lineWrapping': False,
                'modes': ['rst'],
            },
        }
    ),
])
def test_config_helper(on, names, attempted):
    """Helper to update parameters from selected config and with filtered
       returned dict"""
    result = codemirror_settings_update(SAMPLE_DICT, SAMPLE_PARAMETERS, on=on,

# Path: djangocodemirror/helper.py
# def codemirror_settings_update(configs, parameters, on=None, names=None):
#     """
#     Return a new dictionnary of configs updated with given parameters.
# 
#     You may use ``on`` and ``names`` arguments to select config or filter out
#     some configs from returned dict.
# 
#     Arguments:
#         configs (dict): Dictionnary of configurations to update.
#         parameters (dict): Dictionnary of parameters to apply on selected
#             configurations.
# 
#     Keyword Arguments:
#         on (list): List of configuration names to select for update. If empty,
#             all given configurations will be updated.
#         names (list): List of configuration names to keep. If not empty, only
#             those configurations will be in returned dict. Else every
#             configs from original dict will be present.
# 
#     Returns:
#         dict: Dict of configurations with updated parameters.
#     """
#     # Deep copy of given config
#     output = copy.deepcopy(configs)
# 
#     # Optionnaly filtering config from given names
#     if names:
#         output = {k: output[k] for k in names}
# 
#     # Select every config if selectors is empty
#     if not on:
#         on = output.keys()
# 
#     for k in on:
#         output[k].update(parameters)
# 
#     return output


# Path: tests/001_manifest/test_005_helper.py
import pytest
from djangocodemirror.helper import codemirror_settings_update

                'modes': ['rst'],
            },
            'basic': {
                'mode': 'rst',
                'foo': 'bar',
                'css_bundle_name': None,
                'lineWrapping': False,
                'modes': ['rst'],
            },
            'with-options': {
                'mode': 'rst',
                'foo': 'bar',
                'css_bundle_name': None,
                'lineWrapping': False,
                'modes': ['rst'],
            },
            'with-all': {
                'mode': 'rst',
                'foo': 'bar',
                'css_bundle_name': None,
                'lineWrapping': False,
                'modes': ['rst'],
            },
        }
    ),
])
def test_config_helper(on, names, attempted):
    """Helper to update parameters from selected config and with filtered
       returned dict"""
    result = codemirror_settings_update(SAMPLE_DICT, SAMPLE_PARAMETERS, on=on,

                                        names=names)