def test_blob_get_empty_slice(self):
self.assertEqual(self.blob[5:5], b"")
+ def test_blob_get_empty_slice_oob_indices(self):
+ self.cx.execute("insert into test(b) values (?)", (b"abc",))
+ with self.cx.blobopen("test", "b", 2) as blob:
+ self.assertEqual(blob[5:-5], b"")
+
def test_blob_get_slice_negative_index(self):
self.assertEqual(self.blob[5:-5], self.data[5:-5])
return NULL;
}
+ if (len == 0) {
+ return PyBytes_FromStringAndSize(NULL, 0);
+ }
+
if (step == 1) {
return read_multiple(self, len, start);
}