Exemplo n.º 1
0
 def testPositiveWithTuple(self):
     self.assertEqual(getAnagrams('dam', ('dam', 'ma d', 'mam')),
                      ['dam', 'ma d'])
Exemplo n.º 2
0
 def testException(self):
     self.assertRaises(TypeError, getAnagrams(1, [1, 2, 3]), [1])
Exemplo n.º 3
0
 def testPositiveWithSpace(self):
     inputList = ['Ogdred Weary', 'Regera Dowdy', 'E G Deadworry']
     expectedOutput = ['Ogdred Weary', 'Regera Dowdy', 'E G Deadworry']
     self.assertEqual(getAnagrams('Edward Gorey', inputList),
                      expectedOutput)
Exemplo n.º 4
0
 def testNegativeWithList(self):
     self.assertNotEqual(getAnagrams('abc', ['abc', 'cba', 'ba']), ['ba'])
Exemplo n.º 5
0
 def testPositiveWithList(self):
     inputList = ['pastier', 'pirates', 'traipse', 'piratis']
     expectedOutput = ['pastier', 'pirates', 'traipse']
     self.assertEqual(getAnagrams('parties', inputList), expectedOutput)