From 410912d8f0b05eb15ff51348d26da9994bf60134 Mon Sep 17 00:00:00 2001 From: Rob Speer Date: Thu, 21 May 2015 20:36:09 -0400 Subject: [PATCH] remove old tests --- tests/test_queries.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 tests/test_queries.py diff --git a/tests/test_queries.py b/tests/test_queries.py deleted file mode 100644 index 8b44a23..0000000 --- a/tests/test_queries.py +++ /dev/null @@ -1,42 +0,0 @@ -from __future__ import unicode_literals -from nose.tools import eq_, assert_almost_equal, assert_greater -from wordfreq import word_frequency -from wordfreq.query import (average_frequency, wordlist_size, - wordlist_info) - - -def test_freq_examples(): - assert_almost_equal( - word_frequency('normalization', 'en', 'google-books'), - 1.767e-6, places=9 - ) - assert_almost_equal( - word_frequency('normalization', 'en', 'google-books', 1e-6), - 2.767e-6, places=9 - ) - assert_almost_equal( - word_frequency('normalisation', 'fr', 'leeds-internet'), - 4.162e-6, places=9 - ) - assert_greater( - word_frequency('lol', 'xx', 'twitter'), - word_frequency('lol', 'en', 'google-books') - ) - eq_( - word_frequency('totallyfakeword', 'en', 'multi', .5), - .5 - ) - - -def _check_normalized_frequencies(wordlist, lang): - assert_almost_equal( - average_frequency(wordlist, lang) * wordlist_size(wordlist, lang), - 1.0, places=6 - ) - - -def test_normalized_frequencies(): - for list_info in wordlist_info(): - wordlist = list_info['wordlist'] - lang = list_info['lang'] - yield _check_normalized_frequencies, wordlist, lang