From 28e5f940dc58ce085c14a0f67eb981866f366f36 Mon Sep 17 00:00:00 2001 From: awwaawwa <8493196+awwaawwa@users.noreply.github.com> Date: Mon, 23 Dec 2024 23:36:37 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test(translator):=20add=20cache=20i?= =?UTF-8?q?gnore=20tests=20for=20translation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add test case to check translation without cache - assert results are not equal when ignoring cache --- test/test_translator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test_translator.py b/test/test_translator.py index 6ce3753d..d7e69949 100644 --- a/test/test_translator.py +++ b/test/test_translator.py @@ -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)