def test_cannonize_repeated_letters(self): self.assertNotEqual( cannonize("aaaaab"), cannonize("aab")) self.assertEqual( cannonize("aaab"), cannonize("aaab"))
def test_cannonize_ignores_punctuation(self): self.assertEqual( cannonize("it's"), cannonize("its")) self.assertEqual( cannonize(")@(&#%)(@&#Compound-Word*@(#(&!)"), cannonize("'(@@@)'Compou'ndWord&&&&&&&&&$$@()@#"))
def test_cannonize_whitespace(self): self.assertEqual( cannonize("anagram"), cannonize("nag a ram")) self.assertEqual( cannonize(" a b c "), cannonize("abc")) self.assertEqual( cannonize("""a b c d e f """), cannonize("abcdef"))
def test_cannonize_handles_case(self): self.assertEqual( cannonize("wOrd"), cannonize("WoRd"))
def test_cannonize_matches_same_twice(self): self.assertEqual( cannonize("word"), cannonize("word"))