Merge pull request #35 from LuminosoInsight/big-list-test-fix

fix Arabic test, where 'lol' is no longer common
This commit is contained in:
Andrew Lin 2016-05-11 17:20:01 -04:00
commit 3a6d985203

View File

@ -21,11 +21,13 @@ def test_languages():
avail = available_languages() avail = available_languages()
assert_greater(len(avail), 15) assert_greater(len(avail), 15)
# Laughter is the universal language. Look up either 'lol' or '笑' in each # Look up a word representing laughter in each language, and make sure
# language and make sure it has a non-zero frequency. # it has a non-zero frequency.
for lang in avail: for lang in avail:
if lang in {'zh', 'ja'}: if lang in {'zh', 'ja'}:
text = '' text = ''
elif lang == 'ar':
text = 'ههههه'
else: else:
text = 'lol' text = 'lol'
assert_greater(word_frequency(text, lang), 0) assert_greater(word_frequency(text, lang), 0)
@ -33,7 +35,7 @@ def test_languages():
# Make up a weirdly verbose language code and make sure # Make up a weirdly verbose language code and make sure
# we still get it # we still get it
new_lang_code = '%s-001-x-fake-extension' % lang.upper() new_lang_code = '%s-001-x-fake-extension' % lang.upper()
assert_greater(word_frequency(text, new_lang_code), 0) assert_greater(word_frequency(text, new_lang_code), 0, (text, new_lang_code))
def test_twitter(): def test_twitter():