# Path: djangocodemirror/exceptions.py
# class UnknowModeError(KeyError):
#     pass


import pytest
    import json
from django.conf import settings as legacy_settings
from djangocodemirror.exceptions import UnknowModeError




# Since we dont have names for addons, name it here to avoid retyping them for
# every test
ADDON_DIALOG = 'CodeMirror/lib/util/dialog.js'
ADDON_SEARCH = 'CodeMirror/lib/util/search.js'
ADDON_SEARCHCURSOR = 'CodeMirror/lib/util/searchcursor.js'


def test_js_empty_registry(settings, manifesto):
    """Empty registry"""
    assert manifesto.js() == settings.CODEMIRROR_BASE_JS


def test_js_registred_empty(settings, manifesto):
    """An empty registred config"""
    manifesto.autoregister()

    assert manifesto.js('empty') == settings.CODEMIRROR_BASE_JS


def test_resolve_mode_success(settings, manifesto):
    """Resolve a mode name"""
    assert manifesto.resolve_mode('python') == settings.CODEMIRROR_MODES['python']


def test_resolve_mode_error(settings, manifesto):
    """Try to resolve a mode name that does not exist"""

# Path: djangocodemirror/exceptions.py
# class UnknowModeError(KeyError):
#     pass


# Path: tests/001_manifest/test_002_js.py
import pytest
    import json
from django.conf import settings as legacy_settings
from djangocodemirror.exceptions import UnknowModeError





# Since we dont have names for addons, name it here to avoid retyping them for
# every test
ADDON_DIALOG = 'CodeMirror/lib/util/dialog.js'
ADDON_SEARCH = 'CodeMirror/lib/util/search.js'
ADDON_SEARCHCURSOR = 'CodeMirror/lib/util/searchcursor.js'


def test_js_empty_registry(settings, manifesto):
    """Empty registry"""
    assert manifesto.js() == settings.CODEMIRROR_BASE_JS


def test_js_registred_empty(settings, manifesto):
    """An empty registred config"""
    manifesto.autoregister()

    assert manifesto.js('empty') == settings.CODEMIRROR_BASE_JS


def test_resolve_mode_success(settings, manifesto):
    """Resolve a mode name"""
    assert manifesto.resolve_mode('python') == settings.CODEMIRROR_MODES['python']


def test_resolve_mode_error(settings, manifesto):
    """Try to resolve a mode name that does not exist"""

    with pytest.raises(UnknowModeError):