Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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")
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")