Skip to content

Commit

Permalink
✅ test(translator): add cache ignore tests for translation
Browse files Browse the repository at this point in the history
- add test case to check translation without cache
- assert results are not equal when ignoring cache
  • Loading branch information
awwaawwa committed Dec 23, 2024
1 parent e4db1bd commit 28e5f94
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def test_add_cache_impact_parameters(self):
self.assertNotEqual(first_result, second_result)

# Test cache with ignore_cache=True
no_cache_result = translator.translate(text, ignore_cache=True)
self.assertNotEqual(first_result, no_cache_result)

translator.ignore_cache = True
no_cache_result = translator.translate(text)
self.assertNotEqual(first_result, no_cache_result)
Expand Down

0 comments on commit 28e5f94

Please sign in to comment.