tests/delete_many_with_prefix.py
raw| 1 | from conftest import TestData |
| 2 | |
| 3 | |
| 4 | class DeleteManyWithPrefixTests(TestData): |
| 5 | """Tests for the 'delete_many' method when a key prefix is used""" |
| 6 | |
| 7 | def test_delete_many_with_prefix(self): |
| 8 | cache = self.cache_factory(key_prefix="test_prefix:") |
| 9 | cache.set_many({"foo": 1, "bar": 2, "baz": 3}) |
| 10 | result = cache.delete_many("foo", "bar", "baz") |
| 11 | assert result == ["foo", "bar", "baz"] |
| 12 | assert not any(cache.get_many("foo", "bar", "baz")) |