1
+ import pytest
1
2
import datajoint as dj
2
3
import timeit
3
4
import numpy as np
10
11
from .schema import Longblob
11
12
12
13
14
+ @pytest .fixture
15
+ def enable_feature_32bit_dims ():
16
+ dj .blob .use_32bit_dims = True
17
+ yield
18
+ dj .blob .use_32bit_dims = False
19
+
20
+
13
21
def test_pack ():
14
22
for x in (
15
23
32 ,
@@ -180,6 +188,8 @@ def test_insert_longblob(schema_any):
180
188
assert (Longblob & "id=1" ).fetch1 ()["data" ].all () == query_mym_blob ["data" ].all ()
181
189
(Longblob & "id=1" ).delete ()
182
190
191
+
192
+ def test_insert_longblob_32bit (schema_any , enable_feature_32bit_dims ):
183
193
query_32_blob = (
184
194
"INSERT INTO djtest_test1.longblob (id, data) VALUES (1, "
185
195
"X'6D596D00530200000001000000010000000400000068697473007369646573007461736B73007374"
@@ -190,7 +200,6 @@ def test_insert_longblob(schema_any):
190
200
"00000041020000000100000008000000040000000000000053007400610067006500200031003000')"
191
201
)
192
202
dj .conn ().query (query_32_blob ).fetchall ()
193
- dj .blob .use_32bit_dims = True
194
203
fetched = (Longblob & "id=1" ).fetch1 ()
195
204
expected = {
196
205
"id" : 1 ,
@@ -211,7 +220,6 @@ def test_insert_longblob(schema_any):
211
220
assert fetched ["id" ] == expected ["id" ]
212
221
assert np .array_equal (fetched ["data" ], expected ["data" ])
213
222
(Longblob & "id=1" ).delete ()
214
- dj .blob .use_32bit_dims = False
215
223
216
224
217
225
def test_datetime_serialization_speed ():
0 commit comments