Skip to content

Instantly share code, notes, and snippets.

@LucasMagnum
Created November 5, 2018 09:49
Show Gist options
  • Save LucasMagnum/d637f485e253a2da12f26a2e2fd5f3d8 to your computer and use it in GitHub Desktop.
Save LucasMagnum/d637f485e253a2da12f26a2e2fd5f3d8 to your computer and use it in GitHub Desktop.
Word Analysis
import unittest
from words_analysis import get_most_common_words
class TestWordsAnalysis(unittest.TestCase):
def test_get_most_common_words_should_return_the_expected_words(self):
data = [
'python',
'ruby',
'java',
'python',
'earlang',
'java',
'golang',
'javascript',
'python'
]
expected = [
('python', 3),
('java', 2)
]
most_common_words = get_most_common_words(data, 2)
assert most_common_words == expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment