Created
November 5, 2018 09:49
-
-
Save LucasMagnum/d637f485e253a2da12f26a2e2fd5f3d8 to your computer and use it in GitHub Desktop.
Word Analysis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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