Skip to content

Commit

Permalink
✅ test(test_translator): fix cache test
Browse files Browse the repository at this point in the history
  • Loading branch information
awwaawwa committed Dec 28, 2024
1 parent 8738c95 commit 7850d32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ 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)
no_cache_result1 = translator.translate(text, ignore_cache=True)
self.assertNotEqual(first_result, no_cache_result1)

translator.ignore_cache = True
no_cache_result = translator.translate(text)
self.assertNotEqual(first_result, no_cache_result)
no_cache_result2 = translator.translate(text)
self.assertNotEqual(no_cache_result1, no_cache_result2)

# Test cache with ignore_cache=False
translator.ignore_cache = False
cache_result = translator.translate(text)
self.assertEqual(second_result, cache_result)
self.assertEqual(no_cache_result2, cache_result)

# Test cache with another parameter
translator.add_cache_impact_parameters("test2", "value2")
Expand Down

0 comments on commit 7850d32

Please sign in to comment.