File: test_complete_set.py

package info (click to toggle)
python-lunr 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,644 kB
  • sloc: python: 3,811; javascript: 114; makefile: 60
file content (14 lines) | stat: -rw-r--r-- 399 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from lunr.utils import CompleteSet


class TestCompleteSet:
    def test_always_contains_other_element(self):
        assert "foo" in CompleteSet()

    def test_intersection_returns_other(self):
        cs = CompleteSet({"bar"})
        assert cs.intersection({"foo"}) == {"foo"}

    def test_union_returns_self(self):
        cs = CompleteSet({"bar"})
        assert cs.union({"foo"}) == {"bar"}