def test_compute_suffix(self, word, expected): assert expected == KoreanWord(word).suffix
def test_init_incorrect_etymology(self): with pytest.raises(ValueError): KoreanWord(u'안녕', etymology=u'安寧安寧')
def test_init(self, string, etymology, meaning, compute_etymology): KoreanWord(string, etymology, meaning, compute_etymology)
def test_get_words_with_block(self, input_str, exclude, input_str_expected): word = KoreanWord(input_str, compute_etymology=True) block = word.get_blocks_for_selected_meaning()[0] words = DbUtil().get_words_with_block(block, exclude=exclude) assert len(words) > 0 assert input_str_expected == (input_str in [word[0] for word in words])
def test_render_block(self): words = [KoreanWord(string=u'남대문', etymology=u'南大門', meaning=u'(건축물) Namdaemun, the (Great) South Gate (of Seoul)')] ui.render_block(self.block(), words)
def korean_word(): return KoreanWord(u'남대문', u'南大門', u'(건축물) Namdaemun, the (Great) South Gate (of Seoul)')