Skip to content

Commit ec6fed4

Browse files
committed
test that from_vector(BinaryVector(), dtype=...) raises an error
1 parent 67c7ad2 commit ec6fed4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/test_bson.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,13 @@ def test_vector(self):
802802
assert float_binary == Binary.from_vector(
803803
BinaryVector(list_vector, BinaryVectorDtype.FLOAT32)
804804
)
805+
# Confirm kwargs cannot be passed when BinaryVector is provided
806+
self.assertRaises(
807+
ValueError,
808+
Binary.from_vector,
809+
BinaryVector(list_vector, BinaryVectorDtype.PACKED_BIT, padding),
810+
{"dtype": BinaryVectorDtype.PACKED_BIT},
811+
)
805812

806813
def test_unicode_regex(self):
807814
"""Tests we do not get a segfault for C extension on unicode RegExs.

0 commit comments

Comments
 (0)