File: test_bitwise.py

package info (click to toggle)
python-beanie 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,480 kB
  • sloc: python: 14,427; makefile: 7; sh: 6
file content (27 lines) | stat: -rw-r--r-- 672 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from beanie.odm.operators.find.bitwise import (
    BitsAllClear,
    BitsAllSet,
    BitsAnyClear,
    BitsAnySet,
)
from tests.odm.models import Sample


async def test_bits_all_clear():
    q = BitsAllClear(Sample.integer, "smth")
    assert q == {"integer": {"$bitsAllClear": "smth"}}


async def test_bits_all_set():
    q = BitsAllSet(Sample.integer, "smth")
    assert q == {"integer": {"$bitsAllSet": "smth"}}


async def test_any_clear():
    q = BitsAnyClear(Sample.integer, "smth")
    assert q == {"integer": {"$bitsAnyClear": "smth"}}


async def test_any_set():
    q = BitsAnySet(Sample.integer, "smth")
    assert q == {"integer": {"$bitsAnySet": "smth"}}