@@ -171,9 +171,9 @@ def fallback_mock(project):
171171 client = klass ()
172172 self .assertEqual (client .project , OTHER )
173173 self .assertIsNone (client .namespace )
174- self .assertIsInstance (client .connection , _MockConnection )
175- self .assertIs (client .connection .credentials , creds )
176- self .assertIsNone (client .connection .http )
174+ self .assertIsInstance (client ._connection , _MockConnection )
175+ self .assertIs (client ._connection .credentials , creds )
176+ self .assertIsNone (client ._connection .http )
177177 self .assertIsNone (client .current_batch )
178178 self .assertIsNone (client .current_transaction )
179179 self .assertEqual (default_called , [None ])
@@ -189,9 +189,9 @@ def test_ctor_w_explicit_inputs(self):
189189 http = http )
190190 self .assertEqual (client .project , OTHER )
191191 self .assertEqual (client .namespace , NAMESPACE )
192- self .assertIsInstance (client .connection , _MockConnection )
193- self .assertIs (client .connection .credentials , creds )
194- self .assertIs (client .connection .http , http )
192+ self .assertIsInstance (client ._connection , _MockConnection )
193+ self .assertIs (client ._connection .credentials , creds )
194+ self .assertIs (client ._connection .http , http )
195195 self .assertIsNone (client .current_batch )
196196 self .assertEqual (list (client ._batch_stack ), [])
197197
@@ -269,7 +269,7 @@ def test_get_multi_miss(self):
269269
270270 creds = object ()
271271 client = self ._make_one (credentials = creds )
272- client .connection ._add_lookup_result ()
272+ client ._connection ._add_lookup_result ()
273273 key = Key ('Kind' , 1234 , project = self .PROJECT )
274274 results = client .get_multi ([key ])
275275 self .assertEqual (results , [])
@@ -291,7 +291,7 @@ def test_get_multi_miss_w_missing(self):
291291 creds = object ()
292292 client = self ._make_one (credentials = creds )
293293 # Set missing entity on mock connection.
294- client .connection ._add_lookup_result (missing = [missed ])
294+ client ._connection ._add_lookup_result (missing = [missed ])
295295
296296 key = Key (KIND , ID , project = self .PROJECT )
297297 missing = []
@@ -330,7 +330,7 @@ def test_get_multi_miss_w_deferred(self):
330330 # Set deferred entity on mock connection.
331331 creds = object ()
332332 client = self ._make_one (credentials = creds )
333- client .connection ._add_lookup_result (deferred = [key .to_protobuf ()])
333+ client ._connection ._add_lookup_result (deferred = [key .to_protobuf ()])
334334
335335 deferred = []
336336 entities = client .get_multi ([key ], deferred = deferred )
@@ -356,8 +356,8 @@ def test_get_multi_w_deferred_from_backend_but_not_passed(self):
356356 creds = object ()
357357 client = self ._make_one (credentials = creds )
358358 # mock up two separate requests
359- client .connection ._add_lookup_result ([entity1_pb ], deferred = [key2_pb ])
360- client .connection ._add_lookup_result ([entity2_pb ])
359+ client ._connection ._add_lookup_result ([entity1_pb ], deferred = [key2_pb ])
360+ client ._connection ._add_lookup_result ([entity2_pb ])
361361
362362 missing = []
363363 found = client .get_multi ([key1 , key2 ], missing = missing )
@@ -373,7 +373,7 @@ def test_get_multi_w_deferred_from_backend_but_not_passed(self):
373373 self .assertEqual (found [1 ].key .path , key2 .path )
374374 self .assertEqual (found [1 ].key .project , key2 .project )
375375
376- cw = client .connection ._lookup_cw
376+ cw = client ._connection ._lookup_cw
377377 self .assertEqual (len (cw ), 2 )
378378
379379 ds_id , k_pbs , eventual , tid = cw [0 ]
@@ -404,7 +404,7 @@ def test_get_multi_hit(self):
404404 # Make a connection to return the entity pb.
405405 creds = object ()
406406 client = self ._make_one (credentials = creds )
407- client .connection ._add_lookup_result ([entity_pb ])
407+ client ._connection ._add_lookup_result ([entity_pb ])
408408
409409 key = Key (KIND , ID , project = self .PROJECT )
410410 result , = client .get_multi ([key ])
@@ -431,7 +431,7 @@ def test_get_multi_hit_w_transaction(self):
431431 # Make a connection to return the entity pb.
432432 creds = object ()
433433 client = self ._make_one (credentials = creds )
434- client .connection ._add_lookup_result ([entity_pb ])
434+ client ._connection ._add_lookup_result ([entity_pb ])
435435
436436 key = Key (KIND , ID , project = self .PROJECT )
437437 txn = client .transaction ()
@@ -446,7 +446,7 @@ def test_get_multi_hit_w_transaction(self):
446446 self .assertEqual (list (result ), ['foo' ])
447447 self .assertEqual (result ['foo' ], 'Foo' )
448448
449- cw = client .connection ._lookup_cw
449+ cw = client ._connection ._lookup_cw
450450 self .assertEqual (len (cw ), 1 )
451451 _ , _ , _ , transaction_id = cw [0 ]
452452 self .assertEqual (transaction_id , TXN_ID )
@@ -465,7 +465,7 @@ def test_get_multi_hit_multiple_keys_same_project(self):
465465 # Make a connection to return the entity pbs.
466466 creds = object ()
467467 client = self ._make_one (credentials = creds )
468- client .connection ._add_lookup_result ([entity_pb1 , entity_pb2 ])
468+ client ._connection ._add_lookup_result ([entity_pb1 , entity_pb2 ])
469469
470470 key1 = Key (KIND , ID1 , project = self .PROJECT )
471471 key2 = Key (KIND , ID2 , project = self .PROJECT )
@@ -508,7 +508,7 @@ def test_get_multi_max_loops(self):
508508 # Make a connection to return the entity pb.
509509 creds = object ()
510510 client = self ._make_one (credentials = creds )
511- client .connection ._add_lookup_result ([entity_pb ])
511+ client ._connection ._add_lookup_result ([entity_pb ])
512512
513513 key = Key (KIND , ID , project = self .PROJECT )
514514 deferred = []
@@ -564,14 +564,14 @@ def test_put_multi_no_batch_w_partial_key(self):
564564
565565 creds = object ()
566566 client = self ._make_one (credentials = creds )
567- client .connection ._commit .append ([_KeyPB (key )])
567+ client ._connection ._commit .append ([_KeyPB (key )])
568568
569569 result = client .put_multi ([entity ])
570570 self .assertIsNone (result )
571571
572- self .assertEqual (len (client .connection ._commit_cw ), 1 )
572+ self .assertEqual (len (client ._connection ._commit_cw ), 1 )
573573 (project ,
574- commit_req , transaction_id ) = client .connection ._commit_cw [0 ]
574+ commit_req , transaction_id ) = client ._connection ._commit_cw [0 ]
575575 self .assertEqual (project , self .PROJECT )
576576
577577 mutated_entity = _mutated_pb (self , commit_req .mutations , 'insert' )
@@ -627,20 +627,20 @@ def test_delete_multi_no_keys(self):
627627 client = self ._make_one (credentials = creds )
628628 result = client .delete_multi ([])
629629 self .assertIsNone (result )
630- self .assertEqual (len (client .connection ._commit_cw ), 0 )
630+ self .assertEqual (len (client ._connection ._commit_cw ), 0 )
631631
632632 def test_delete_multi_no_batch (self ):
633633 key = _Key (self .PROJECT )
634634
635635 creds = object ()
636636 client = self ._make_one (credentials = creds )
637- client .connection ._commit .append ([])
637+ client ._connection ._commit .append ([])
638638
639639 result = client .delete_multi ([key ])
640640 self .assertIsNone (result )
641- self .assertEqual (len (client .connection ._commit_cw ), 1 )
641+ self .assertEqual (len (client ._connection ._commit_cw ), 1 )
642642 (project ,
643- commit_req , transaction_id ) = client .connection ._commit_cw [0 ]
643+ commit_req , transaction_id ) = client ._connection ._commit_cw [0 ]
644644 self .assertEqual (project , self .PROJECT )
645645
646646 mutated_key = _mutated_pb (self , commit_req .mutations , 'delete' )
@@ -658,7 +658,7 @@ def test_delete_multi_w_existing_batch(self):
658658 self .assertIsNone (result )
659659 mutated_key = _mutated_pb (self , CURR_BATCH .mutations , 'delete' )
660660 self .assertEqual (mutated_key , key ._key )
661- self .assertEqual (len (client .connection ._commit_cw ), 0 )
661+ self .assertEqual (len (client ._connection ._commit_cw ), 0 )
662662
663663 def test_delete_multi_w_existing_transaction (self ):
664664 creds = object ()
@@ -671,7 +671,7 @@ def test_delete_multi_w_existing_transaction(self):
671671 self .assertIsNone (result )
672672 mutated_key = _mutated_pb (self , CURR_XACT .mutations , 'delete' )
673673 self .assertEqual (mutated_key , key ._key )
674- self .assertEqual (len (client .connection ._commit_cw ), 0 )
674+ self .assertEqual (len (client ._connection ._commit_cw ), 0 )
675675
676676 def test_allocate_ids_w_partial_key (self ):
677677 NUM_IDS = 2
0 commit comments