Created
December 13, 2013 23:05
-
-
Save thebenedict/7953017 to your computer and use it in GitHub Desktop.
Test suite for anagrams.py, at https://gist.github.com/thebenedict/7655053
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 StringIO import StringIO | |
from anagrams import find_anagrams | |
class AnagramsTestCase(unittest.TestCase): | |
"""Tests for anagrams.py""" | |
def test_finds_simple_anagrams(self): | |
"""Does it find anagrams for 'art'?""" | |
anas = find_anagrams(StringIO("art\nrat\ntar")) | |
self.assertEqual({"art": ["art", "rat", "tar"]}, anas) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment