Test basic set and get operations
(self)
| 15 | cache.clean_test_db(self.test_db) |
| 16 | |
| 17 | def test_basic_set_get(self): |
| 18 | """Test basic set and get operations""" |
| 19 | cache_instance = cache.TranslationCache("test_engine") |
| 20 | |
| 21 | # Test get with non-existent entry |
| 22 | result = cache_instance.get("hello") |
| 23 | self.assertIsNone(result) |
| 24 | |
| 25 | # Test set and get |
| 26 | cache_instance.set("hello", "你好") |
| 27 | result = cache_instance.get("hello") |
| 28 | self.assertEqual(result, "你好") |
| 29 | |
| 30 | def test_cache_overwrite(self): |
| 31 | """Test that cache entries can be overwritten""" |