2023-12-21 14:13:31 +03:00
|
|
|
from __future__ import annotations
|
2024-01-20 14:23:03 +03:00
|
|
|
|
2024-09-02 01:19:44 +03:00
|
|
|
import pytest
|
|
|
|
|
2019-11-04 01:18:55 +03:00
|
|
|
from .helper import hopper
|
2019-07-06 23:40:53 +03:00
|
|
|
|
2016-02-05 01:57:13 +03:00
|
|
|
|
2024-01-25 14:18:46 +03:00
|
|
|
def test_sanity() -> None:
|
2019-11-04 01:18:55 +03:00
|
|
|
im = hopper()
|
2012-10-15 09:55:39 +04:00
|
|
|
|
2024-09-02 01:19:44 +03:00
|
|
|
type_repr = repr(type(im.getim()))
|
2019-11-04 01:18:55 +03:00
|
|
|
assert "PyCapsule" in type_repr
|
2024-09-02 01:19:44 +03:00
|
|
|
|
|
|
|
with pytest.warns(DeprecationWarning):
|
|
|
|
assert isinstance(im.im.id, int)
|
|
|
|
|
|
|
|
with pytest.warns(DeprecationWarning):
|
|
|
|
ptrs = dict(im.im.unsafe_ptrs)
|
|
|
|
assert all(k in ptrs for k in ["image8", "image32", "image"])
|