@@ -37,7 +37,7 @@ def test_ctor(self):
37
37
self .assertEqual (batch .connection , connection )
38
38
self .assertEqual (batch .namespace , _NAMESPACE )
39
39
self .assertTrue (batch ._id is None )
40
- self .assertTrue (isinstance (batch .mutation , Mutation ))
40
+ self .assertTrue (isinstance (batch .changes , Mutation ))
41
41
self .assertEqual (batch ._partial_key_entities , [])
42
42
43
43
def test_current (self ):
@@ -89,12 +89,12 @@ def test_put_entity_w_partial_key(self):
89
89
90
90
batch .put (entity )
91
91
92
- insert_auto_ids = list (batch .mutation .insert_auto_id )
92
+ insert_auto_ids = list (batch .changes .insert_auto_id )
93
93
self .assertEqual (len (insert_auto_ids ), 1 )
94
94
self .assertEqual (insert_auto_ids [0 ].key , key ._key )
95
- upserts = list (batch .mutation .upsert )
95
+ upserts = list (batch .changes .upsert )
96
96
self .assertEqual (len (upserts ), 0 )
97
- deletes = list (batch .mutation .delete )
97
+ deletes = list (batch .changes .delete )
98
98
self .assertEqual (len (deletes ), 0 )
99
99
self .assertEqual (batch ._partial_key_entities , [entity ])
100
100
@@ -115,9 +115,9 @@ def test_put_entity_w_completed_key(self):
115
115
116
116
batch .put (entity )
117
117
118
- insert_auto_ids = list (batch .mutation .insert_auto_id )
118
+ insert_auto_ids = list (batch .changes .insert_auto_id )
119
119
self .assertEqual (len (insert_auto_ids ), 0 )
120
- upserts = list (batch .mutation .upsert )
120
+ upserts = list (batch .changes .upsert )
121
121
self .assertEqual (len (upserts ), 1 )
122
122
123
123
upsert = upserts [0 ]
@@ -131,7 +131,7 @@ def test_put_entity_w_completed_key(self):
131
131
self .assertFalse (props ['spam' ].list_value [2 ].indexed )
132
132
self .assertFalse ('frotz' in props )
133
133
134
- deletes = list (batch .mutation .delete )
134
+ deletes = list (batch .changes .delete )
135
135
self .assertEqual (len (deletes ), 0 )
136
136
137
137
def test_put_entity_w_completed_key_prefixed_dataset_id (self ):
@@ -151,9 +151,9 @@ def test_put_entity_w_completed_key_prefixed_dataset_id(self):
151
151
152
152
batch .put (entity )
153
153
154
- insert_auto_ids = list (batch .mutation .insert_auto_id )
154
+ insert_auto_ids = list (batch .changes .insert_auto_id )
155
155
self .assertEqual (len (insert_auto_ids ), 0 )
156
- upserts = list (batch .mutation .upsert )
156
+ upserts = list (batch .changes .upsert )
157
157
self .assertEqual (len (upserts ), 1 )
158
158
159
159
upsert = upserts [0 ]
@@ -167,7 +167,7 @@ def test_put_entity_w_completed_key_prefixed_dataset_id(self):
167
167
self .assertFalse (props ['spam' ].list_value [2 ].indexed )
168
168
self .assertFalse ('frotz' in props )
169
169
170
- deletes = list (batch .mutation .delete )
170
+ deletes = list (batch .changes .delete )
171
171
self .assertEqual (len (deletes ), 0 )
172
172
173
173
def test_delete_w_partial_key (self ):
@@ -198,11 +198,11 @@ def test_delete_w_completed_key(self):
198
198
199
199
batch .delete (key )
200
200
201
- insert_auto_ids = list (batch .mutation .insert_auto_id )
201
+ insert_auto_ids = list (batch .changes .insert_auto_id )
202
202
self .assertEqual (len (insert_auto_ids ), 0 )
203
- upserts = list (batch .mutation .upsert )
203
+ upserts = list (batch .changes .upsert )
204
204
self .assertEqual (len (upserts ), 0 )
205
- deletes = list (batch .mutation .delete )
205
+ deletes = list (batch .changes .delete )
206
206
self .assertEqual (len (deletes ), 1 )
207
207
self .assertEqual (deletes [0 ], key ._key )
208
208
@@ -215,11 +215,11 @@ def test_delete_w_completed_key_w_prefixed_dataset_id(self):
215
215
216
216
batch .delete (key )
217
217
218
- insert_auto_ids = list (batch .mutation .insert_auto_id )
218
+ insert_auto_ids = list (batch .changes .insert_auto_id )
219
219
self .assertEqual (len (insert_auto_ids ), 0 )
220
- upserts = list (batch .mutation .upsert )
220
+ upserts = list (batch .changes .upsert )
221
221
self .assertEqual (len (upserts ), 0 )
222
- deletes = list (batch .mutation .delete )
222
+ deletes = list (batch .changes .delete )
223
223
self .assertEqual (len (deletes ), 1 )
224
224
self .assertEqual (deletes [0 ], key ._key )
225
225
@@ -232,7 +232,7 @@ def test_commit(self):
232
232
batch .commit ()
233
233
234
234
self .assertEqual (connection ._committed ,
235
- [(_DATASET , batch .mutation , None )])
235
+ [(_DATASET , batch .changes , None )])
236
236
237
237
def test_commit_w_partial_key_entities (self ):
238
238
_DATASET = 'DATASET'
@@ -248,7 +248,7 @@ def test_commit_w_partial_key_entities(self):
248
248
batch .commit ()
249
249
250
250
self .assertEqual (connection ._committed ,
251
- [(_DATASET , batch .mutation , None )])
251
+ [(_DATASET , batch .changes , None )])
252
252
self .assertFalse (entity .key .is_partial )
253
253
self .assertEqual (entity .key ._id , _NEW_ID )
254
254
@@ -268,15 +268,15 @@ def test_as_context_mgr_wo_error(self):
268
268
269
269
self .assertEqual (list (client ._batches ), [])
270
270
271
- insert_auto_ids = list (batch .mutation .insert_auto_id )
271
+ insert_auto_ids = list (batch .changes .insert_auto_id )
272
272
self .assertEqual (len (insert_auto_ids ), 0 )
273
- upserts = list (batch .mutation .upsert )
273
+ upserts = list (batch .changes .upsert )
274
274
self .assertEqual (len (upserts ), 1 )
275
275
self .assertEqual (upserts [0 ].key , key ._key )
276
- deletes = list (batch .mutation .delete )
276
+ deletes = list (batch .changes .delete )
277
277
self .assertEqual (len (deletes ), 0 )
278
278
self .assertEqual (connection ._committed ,
279
- [(_DATASET , batch .mutation , None )])
279
+ [(_DATASET , batch .changes , None )])
280
280
281
281
def test_as_context_mgr_nested (self ):
282
282
_DATASET = 'DATASET'
@@ -301,25 +301,25 @@ def test_as_context_mgr_nested(self):
301
301
302
302
self .assertEqual (list (client ._batches ), [])
303
303
304
- insert_auto_ids = list (batch1 .mutation .insert_auto_id )
304
+ insert_auto_ids = list (batch1 .changes .insert_auto_id )
305
305
self .assertEqual (len (insert_auto_ids ), 0 )
306
- upserts = list (batch1 .mutation .upsert )
306
+ upserts = list (batch1 .changes .upsert )
307
307
self .assertEqual (len (upserts ), 1 )
308
308
self .assertEqual (upserts [0 ].key , key1 ._key )
309
- deletes = list (batch1 .mutation .delete )
309
+ deletes = list (batch1 .changes .delete )
310
310
self .assertEqual (len (deletes ), 0 )
311
311
312
- insert_auto_ids = list (batch2 .mutation .insert_auto_id )
312
+ insert_auto_ids = list (batch2 .changes .insert_auto_id )
313
313
self .assertEqual (len (insert_auto_ids ), 0 )
314
- upserts = list (batch2 .mutation .upsert )
314
+ upserts = list (batch2 .changes .upsert )
315
315
self .assertEqual (len (upserts ), 1 )
316
316
self .assertEqual (upserts [0 ].key , key2 ._key )
317
- deletes = list (batch2 .mutation .delete )
317
+ deletes = list (batch2 .changes .delete )
318
318
self .assertEqual (len (deletes ), 0 )
319
319
320
320
self .assertEqual (connection ._committed ,
321
- [(_DATASET , batch2 .mutation , None ),
322
- (_DATASET , batch1 .mutation , None )])
321
+ [(_DATASET , batch2 .changes , None ),
322
+ (_DATASET , batch1 .changes , None )])
323
323
324
324
def test_as_context_mgr_w_error (self ):
325
325
_DATASET = 'DATASET'
@@ -341,12 +341,12 @@ def test_as_context_mgr_w_error(self):
341
341
342
342
self .assertEqual (list (client ._batches ), [])
343
343
344
- insert_auto_ids = list (batch .mutation .insert_auto_id )
344
+ insert_auto_ids = list (batch .changes .insert_auto_id )
345
345
self .assertEqual (len (insert_auto_ids ), 0 )
346
- upserts = list (batch .mutation .upsert )
346
+ upserts = list (batch .changes .upsert )
347
347
self .assertEqual (len (upserts ), 1 )
348
348
self .assertEqual (upserts [0 ].key , key ._key )
349
- deletes = list (batch .mutation .delete )
349
+ deletes = list (batch .changes .delete )
350
350
self .assertEqual (len (deletes ), 0 )
351
351
self .assertEqual (connection ._committed , [])
352
352
0 commit comments