Beispiel #1
0
 def testPositiveWithTuple(self):
     self.assertEqual(getAnagrams('dam', ('dam', 'ma d', 'mam')),
                      ['dam', 'ma d'])
Beispiel #2
0
 def testException(self):
     self.assertRaises(TypeError, getAnagrams(1, [1, 2, 3]), [1])
Beispiel #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)
Beispiel #4
0
 def testNegativeWithList(self):
     self.assertNotEqual(getAnagrams('abc', ['abc', 'cba', 'ba']), ['ba'])
Beispiel #5
0
 def testPositiveWithList(self):
     inputList = ['pastier', 'pirates', 'traipse', 'piratis']
     expectedOutput = ['pastier', 'pirates', 'traipse']
     self.assertEqual(getAnagrams('parties', inputList), expectedOutput)