Skip to content

Commit 9c5a4ae

Browse files
committed
Update example data TestBSON.test_vector as previous example now raises an exception.
1 parent 8b21176 commit 9c5a4ae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/test_bson.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ def test_vector(self):
739739
"""Tests of subtype 9"""
740740
# We start with valid cases, across the 3 dtypes implemented.
741741
# Work with a simple vector that can be interpreted as int8, float32, or ubyte
742-
list_vector = [127, 7]
742+
list_vector = [127, 8]
743743
# As INT8, vector has length 2
744744
binary_vector = Binary.from_vector(list_vector, BinaryVectorDtype.INT8)
745745
vector = binary_vector.as_vector()
@@ -764,18 +764,18 @@ def test_vector(self):
764764
uncompressed = ""
765765
for val in list_vector:
766766
uncompressed += format(val, "08b")
767-
assert uncompressed[:-padding] == "0111111100000"
767+
assert uncompressed[:-padding] == "0111111100001"
768768

769769
# It is worthwhile explicitly showing the values encoded to BSON
770770
padded_doc = {"padded_vec": padded_vec}
771771
assert (
772772
encode(padded_doc)
773-
== b"\x1a\x00\x00\x00\x05padded_vec\x00\x04\x00\x00\x00\t\x10\x03\x7f\x07\x00"
773+
== b"\x1a\x00\x00\x00\x05padded_vec\x00\x04\x00\x00\x00\t\x10\x03\x7f\x08\x00"
774774
)
775775
# and dumped to json
776776
assert (
777777
json_util.dumps(padded_doc)
778-
== '{"padded_vec": {"$binary": {"base64": "EAN/Bw==", "subType": "09"}}}'
778+
== '{"padded_vec": {"$binary": {"base64": "EAN/CA==", "subType": "09"}}}'
779779
)
780780

781781
# FLOAT32 is also implemented

0 commit comments

Comments
 (0)