Skip to content

Commit e714be1

Browse files
committed
test_query: added Id query tests #29
1 parent eee381d commit e714be1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_query.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ def test_basics():
2020
box_vector_entity.put(VectorEntity(name="Object 2", vector_euclidean=[2, 2]))
2121
box_vector_entity.put(VectorEntity(name="Object 3", vector_euclidean=[3, 3]))
2222

23+
# Id query
24+
id_prop: Property = TestEntity.get_property("id")
25+
query = box_test_entity.query(id_prop.equals(id1)).build()
26+
assert query.count() == 1
27+
query = box_test_entity.query(id_prop.greater_than(id1)).build()
28+
assert query.count() == 1
29+
query = box_test_entity.query(id_prop.greater_or_equal(id1)).build()
30+
assert query.count() == 2
31+
query = box_test_entity.query(id_prop.less_than(id2)).build()
32+
assert query.count() == 1
33+
query = box_test_entity.query(id_prop.less_or_equal(id2)).build()
34+
assert query.count() == 2
35+
2336
# Bool query
2437
bool_prop: Property = TestEntity.get_property("bool")
2538
query = box_test_entity.query(bool_prop.equals(True)).build()

0 commit comments

Comments
 (0)