Skip to content

Commit 6312a84

Browse files
committed
test_index.py: test the hash64 index type #12
1 parent de8b6e1 commit 6312a84

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class TestEntity:
1515
int8 = Property(int, type=PropertyType.byte, id=7, uid=1007)
1616
float64 = Property(float, type=PropertyType.double, id=8, uid=1008)
1717
float32 = Property(float, type=PropertyType.float, id=9, uid=1009)
18-
bytes = Property(bytes, id=10, uid=1010)
18+
bytes = Property(bytes, id=10, uid=1010, index_type=IndexType.hash64)
1919
ints = Property(np.ndarray, type=PropertyType.intVector, id=11, uid=1011)
2020
longs = Property(np.ndarray, type=PropertyType.longVector, id=12, uid=1012)
2121
floats = Property(np.ndarray, type=PropertyType.floatVector, id=13, uid=1013)

tests/test_index.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ def test_index_basics():
2828
# int16 - specify index type w/o explicitly enabling index
2929
assert box._entity.properties[5]._index_type == IndexType.hash
3030

31+
# bytes - index type overwritten to hash64
32+
assert box._entity.properties[9]._index_type == IndexType.hash64
33+
3134

3235
def test_index_error():
3336
@Entity(id=3, uid=3)

0 commit comments

Comments
 (0)