Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Park committed Nov 28, 2024
1 parent d9a39da commit 961d2f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions i18nilize/tests/test_error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ def test_non_string_keys(self):
123: "bonjour",
None: "merci"
}
self.assertEqual(handler.handle_invalid_keys(language), "Key '123' is not a string.")
self.assertEqual(handler.handle_invalid_keys(language), "Key is not a string.")

def test_empty_or_whitespace_keys(self):
handler = ErrorHandler({})
language = {
"": "bonjour",
" ": "merci"
}
self.assertEqual(handler.handle_invalid_keys(language), "Key is empty or only contains whitespace.")
self.assertEqual(handler.handle_invalid_keys(language), "Key is empty.")

def test_combined_issues(self):
handler = TranslationHandler({})
handler = ErrorHandler({})
language = {
123: "bonjour",
" ": "merci",
"hello-world": "salut"
}
self.assertEqual(handler.handle_invalid_keys(language), "Key '123' is not a string.")
self.assertEqual(handler.handle_invalid_keys(language), "Key is not a string.")

if __name__ == "__main__":
unittest.main()

0 comments on commit 961d2f6

Please sign in to comment.