def check_anagram():
    firstWord = request.args.get("firstWord", "")
    secondWord = request.args.get("secondWord", "")

    if Anagram.checkIfAnagram(firstWord, secondWord):
        return json.dumps({
            "result": True,
            "message": "Yes! They are anagrams"
        })
    else:
        return json.dumps({
            "result": False,
            "message": "No! They are NOT anagrams"
        })
 def test_check_if_anagram(self):
     # check the words that are anagrams
     self.assertTrue(Anagram.checkIfAnagram("", ""),
                     "Both empty string, they are anagrams")
     self.assertTrue(Anagram.checkIfAnagram("wolf", "flow"),
                     "They are anagrams")
     self.assertTrue(Anagram.checkIfAnagram("WoLf", "FlOw"),
                     "Case insensitive test, they are anagrams")
     self.assertTrue(Anagram.checkIfAnagram("restful", "fluster"),
                     "They are anagrams")
     self.assertTrue(
         Anagram.checkIfAnagram("loooooooooooooooogword",
                                "wordloooooooooooooooog"),
         "They are anagrams")
     self.assertTrue(
         Anagram.checkIfAnagram("TomMarvoloRiddle", "IamLordVoldemort"),
         "They are anagrams")
     # check the words that are not anagrams
     self.assertFalse(Anagram.checkIfAnagram(None, None),
                      "None should just return false")
     self.assertFalse(Anagram.checkIfAnagram("abc", "test"),
                      "They are NOT anagrams")
     self.assertFalse(Anagram.checkIfAnagram("grove", "groove"),
                      "They are NOT anagrams")