veekun_pokedex/pokedex/tests/test_roomaji.py

62 lines
1.7 KiB
Python
Raw Permalink Normal View History

# encoding: utf8
import pytest
parametrize = pytest.mark.parametrize
import pokedex.roomaji
@parametrize(
('kana', 'roomaji'),
[
(u'ヤミカラス', 'yamikarasu'),
# Elongated vowel
(u'イーブイ', 'iibui'),
(u'ホーホー', 'hoohoo'),
2011-01-26 01:14:42 +00:00
(u'ピカチュウ', u'pikachuu'),
# Combined characters
(u'ニャース', 'nyaasu'),
(u'ジャ', 'ja'),
(u'ぎゃくてん', 'gyakuten'),
(u'ウェザーボール', 'wezaabooru'),
# Special katakana combinations
(u'ラティアス', 'ratiasu'),
(u'ウィー', 'wii'),
(u'セレビィ', 'sereby'),
(u'ウッウ', u"u'u"),
]
)
2011-05-02 07:20:28 +00:00
def test_roomaji(kana, roomaji):
result = pokedex.roomaji.romanize(kana)
assert result == roomaji
2011-01-26 01:14:42 +00:00
@parametrize(
('kana', 'roomaji'),
[
2011-01-26 01:14:42 +00:00
(u'ヤミカラス', u'jamikarasu'),
# Elongated vowel
(u'イーブイ', u'íbui'),
(u'ホーホー', u'hóhó'),
(u'ピカチュウ', u'pikačú'),
# Combined characters
(u'ニャース', u'ňjásu'),
(u'ジャ', u'dža'),
(u'ぎゃくてん', u'gjakuten'),
(u'ウェザーボール', u'wezábóru'),
# Special katakana combinations
(u'ラティアス', u'ratiasu'),
(u'ウィー', u''),
(u'セレビィ', u'serebí'),
(u'ウッウ', u"u'u"),
]
)
2011-05-02 07:20:28 +00:00
def test_roomaji_cs(kana, roomaji):
result = pokedex.roomaji.romanize(kana, 'cs')
assert result == roomaji