tests: Test capitaliation of py::sequence and py::buffer

This commit is contained in:
Sergei Izmailov 2023-09-01 09:38:40 +09:00
parent d3d700df2b
commit 46a7dd4b17
2 changed files with 8 additions and 0 deletions

View File

@ -219,3 +219,7 @@ def test_ctypes_from_buffer():
assert cinfo.shape == pyinfo.shape
assert cinfo.strides == pyinfo.strides
assert not cinfo.readonly
def test_buffer_docstring():
assert m.get_buffer_info.__doc__.strip() == "get_buffer_info(arg0: Buffer) -> pybind11_tests.buffers.buffer_info"

View File

@ -171,6 +171,10 @@ def test_sequence_length():
assert m.sequence_length("hello") == 5
def test_sequence_doc():
assert m.sequence_length.__doc__.strip() == "sequence_length(arg0: Sequence) -> int"
def test_map_iterator():
sm = m.StringMap({"hi": "bye", "black": "white"})
assert sm["hi"] == "bye"