Skip to content

Instantly share code, notes, and snippets.

@thebenedict
Created December 13, 2013 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebenedict/7953017 to your computer and use it in GitHub Desktop.
Save thebenedict/7953017 to your computer and use it in GitHub Desktop.
Test suite for anagrams.py, at https://gist.github.com/thebenedict/7655053
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