def _convert_key(name):
    # camelCase to BIG_SNAKE while preserving acronyms, i.e.
    # FooBARs -> FOO_BARS (and not FOO_BA_RS)
    name = re.sub(r'([A-Z])([A-Z]+)', lambda m: m.group(1) + m.group(2).lower(), name)
    name = snakify(name).upper()
    special_cases = {'PDFLATEX_PROGRAM': 'XELATEX_PATH',
                     'IS_ROOM_BOOKING_ACTIVE': 'ENABLE_ROOMBOOKING'}
    return special_cases.get(name, name)
예제 #2
0
파일: config.py 프로젝트: bkolobara/indico
def _convert_key(name):
    # camelCase to BIG_SNAKE while preserving acronyms, i.e.
    # FooBARs -> FOO_BARS (and not FOO_BA_RS)
    name = re.sub(r'([A-Z])([A-Z]+)', lambda m: m.group(1) + m.group(2).lower(), name)
    name = snakify(name).upper()
    special_cases = {'PDFLATEX_PROGRAM': 'XELATEX_PATH',
                     'IS_ROOM_BOOKING_ACTIVE': 'ENABLE_ROOMBOOKING'}
    return special_cases.get(name, name)
예제 #3
0
def test_snakify(input, output):
    assert snakify(input) == output
예제 #4
0
def test_snakify(input, output):
    assert snakify(input) == output