File: has.py

package info (click to toggle)
cachelib 0.13.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 428 kB
  • sloc: python: 1,555; makefile: 32; sh: 15
file content (12 lines) | stat: -rw-r--r-- 346 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
from conftest import TestData


class HasTests(TestData):
    """Tests for the optional 'has' method specified by BaseCache"""

    def test_has(self):
        cache = self.cache_factory()
        assert cache.set_many(self.sample_pairs)
        for k in self.sample_pairs:
            assert cache.has(k)
        assert not cache.has("unknown")