>>> from caseutil import CASES, is_case, to_case

Round trip:

>>> sample = 'My var-name'
>>> all(
...     is_case(c, to_case(c, sample)) is True                         # match self case
...     and sum(is_case(cc, to_case(c, sample)) for cc in CASES) == 1  # but not others
...     for c in CASES
... )
True

Invalid cases raise ValueError:

>>> is_case('unsupported', 'any text')
Traceback (most recent call last):
    ...
ValueError: Unsupported case: unsupported

>>> to_case('unsupported', 'any text')
Traceback (most recent call last):
    ...
ValueError: Unsupported case: unsupported
