How to use the pykakasi.exceptions.InvalidFlagValueException function in pykakasi

To help you get started, we’ve selected a few pykakasi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github miurahr / pykakasi / tests / test_exceptions.py View on Github external
def test_kakasi_invalid_flag_value():
    with pytest.raises(InvalidFlagValueException):
        kakasi = pykakasi.kakasi()
        kakasi.setMode("H", "a")
        kakasi.setMode("K", "a")
        kakasi.setMode("s", "yes")
github miurahr / pykakasi / src / pykakasi / wakati.py View on Github external
def setMode(self, fr, to):
        if fr in self._flag.keys():
            if to in [True, False]:
                self._flag[fr] = to
            else:
                raise InvalidFlagValueException("Invalid flag value")
            raise UnknownOptionsException("Unhandled options")