99
1010
1111def test_basics ():
12- ob = create_test_store ()
12+ store = create_test_store ()
1313
14- box_test_entity = objectbox . Box ( ob , TestEntity )
14+ box_test_entity = store . box ( TestEntity )
1515 box_test_entity .put (TestEntity (str = "foo" , int64 = 123 ))
1616 box_test_entity .put (TestEntity (str = "bar" , int64 = 456 ))
1717
18- box_vector_entity = objectbox . Box ( ob , VectorEntity )
18+ box_vector_entity = store . box ( VectorEntity )
1919 box_vector_entity .put (VectorEntity (name = "Object 1" , vector_euclidean = [1 , 1 ]))
2020 box_vector_entity .put (VectorEntity (name = "Object 2" , vector_euclidean = [2 , 2 ]))
2121 box_vector_entity .put (VectorEntity (name = "Object 3" , vector_euclidean = [3 , 3 ]))
@@ -104,13 +104,13 @@ def test_basics():
104104 assert query .count () == 2
105105 assert query .find_ids () == [2 , 3 ]
106106
107- ob .close ()
107+ store .close ()
108108
109109
110110def test_flex_contains_key_value ():
111- ob = create_test_store ()
111+ store = create_test_store ()
112112
113- box = objectbox . Box ( ob , TestEntityFlex )
113+ box = store . box ( TestEntityFlex )
114114 box .put (TestEntityFlex (flex = {"k1" : "String" , "k2" : 2 , "k3" : "string" }))
115115 box .put (TestEntityFlex (flex = {"k1" : "strinG" , "k2" : 3 , "k3" : 10 , "k4" : [1 , "foo" , 3 ]}))
116116 box .put (TestEntityFlex (flex = {"k1" : "buzz" , "k2" : 3 , "k3" : [2 , 3 ], "k4" : {"k1" : "a" , "k2" : "inner text" }}))
@@ -156,9 +156,9 @@ def test_flex_contains_key_value():
156156
157157
158158def test_offset_limit ():
159- ob = load_empty_test_default_store ()
159+ store = load_empty_test_default_store ()
160160
161- box = objectbox . Box ( ob , TestEntity )
161+ box = store . box ( TestEntity )
162162 box .put (TestEntity ())
163163 box .put (TestEntity (str = "a" ))
164164 box .put (TestEntity (str = "b" ))
@@ -185,9 +185,9 @@ def test_offset_limit():
185185
186186
187187def test_any_all ():
188- db = create_test_store ()
188+ store = create_test_store ()
189189
190- box = objectbox . Box ( db , TestEntity )
190+ box = store . box ( TestEntity )
191191
192192 box .put (TestEntity (str = "Foo" , int32 = 10 , int8 = 2 , float32 = 3.14 , bool = True ))
193193 box .put (TestEntity (str = "FooBar" , int32 = 100 , int8 = 50 , float32 = 2.0 , bool = True ))
@@ -247,17 +247,17 @@ def test_any_all():
247247
248248
249249def test_set_parameter ():
250- db = create_test_store ()
250+ store = create_test_store ()
251251
252- box_test_entity = objectbox . Box ( db , TestEntity )
252+ box_test_entity = store . box ( TestEntity )
253253 box_test_entity .put (TestEntity (str = "Foo" , int64 = 2 , int32 = 703 , int8 = 101 ))
254254 box_test_entity .put (TestEntity (str = "FooBar" , int64 = 10 , int32 = 49 , int8 = 45 ))
255255 box_test_entity .put (TestEntity (str = "Bar" , int64 = 10 , int32 = 226 , int8 = 126 ))
256256 box_test_entity .put (TestEntity (str = "Foster" , int64 = 2 , int32 = 301 , int8 = 42 ))
257257 box_test_entity .put (TestEntity (str = "Fox" , int64 = 10 , int32 = 157 , int8 = 11 ))
258258 box_test_entity .put (TestEntity (str = "Barrakuda" , int64 = 4 , int32 = 386 , int8 = 60 ))
259259
260- box_vector_entity = objectbox . Box ( db , VectorEntity )
260+ box_vector_entity = store . box ( VectorEntity )
261261 box_vector_entity .put (VectorEntity (name = "Object 1" , vector_euclidean = [1 , 1 ]))
262262 box_vector_entity .put (VectorEntity (name = "Object 2" , vector_euclidean = [2 , 2 ]))
263263 box_vector_entity .put (VectorEntity (name = "Object 3" , vector_euclidean = [3 , 3 ]))
@@ -300,13 +300,13 @@ def test_set_parameter():
300300
301301
302302def test_set_parameter_alias ():
303- db = create_test_store ()
304- box = objectbox . Box ( db , TestEntity )
303+ store = create_test_store ()
304+ box = store . box ( TestEntity )
305305
306306 box .put (TestEntity (str = "Foo" , int64 = 2 , int32 = 703 , int8 = 101 ))
307307 box .put (TestEntity (str = "FooBar" , int64 = 10 , int32 = 49 , int8 = 45 ))
308308
309- box_vector = objectbox . Box ( db , VectorEntity )
309+ box_vector = store . box ( VectorEntity )
310310 box_vector .put (VectorEntity (name = "Object 1" , vector_euclidean = [1 , 1 ]))
311311 box_vector .put (VectorEntity (name = "Object 2" , vector_euclidean = [2 , 2 ]))
312312 box_vector .put (VectorEntity (name = "Object 3" , vector_euclidean = [3 , 3 ]))
@@ -375,10 +375,10 @@ def test_set_parameter_alias():
375375
376376def test_set_parameter_alias_advanced ():
377377 """ Tests set_parameter_alias in a complex scenario (i.e. multiple query conditions/logical aggregations). """
378- db = create_test_store ()
378+ store = create_test_store ()
379379
380380 # Setup 1
381- box = objectbox . Box ( db , TestEntity )
381+ box = store . box ( TestEntity )
382382 box .put (TestEntity (str = "Apple" , bool = False , int64 = 47 , int32 = 70 ))
383383 box .put (TestEntity (str = "applE" , bool = True , int64 = 253 , int32 = 798 ))
384384 box .put (TestEntity (str = "APPLE" , bool = False , int64 = 3456 , int32 = 123 ))
0 commit comments