def test_Data_writable_data(data): copy = skia.Data(data, True) view = copy.writable_data() assert isinstance(view, memoryview) assert not view.readonly view.cast('B')[0] = 0 # cast needed due to pybind11 issue #2223 assert not data.equals(copy)
def test_Canvas_drawAnnotation(canvas): canvas.drawAnnotation(skia.Rect(10, 10), 'key', skia.Data(b'\x00\x00\x00\x00'))
def data(png_data): return skia.Data(png_data, True)
def test_Data_init(args): assert isinstance(skia.Data(*args), skia.Data)
def test_MemoryStream_Make(): buf = skia.Data(b'\x00\x00') assert isinstance(skia.MemoryStream.MakeDirect(buf), skia.MemoryStream)