@@ -26,6 +26,7 @@ def _makeOne(self, client):
2626
2727 def test_ctor (self ):
2828 from gcloud .datastore ._datastore_v1_pb2 import Mutation
29+ from gcloud .datastore .test_batch import _Client
2930
3031 _DATASET = 'DATASET'
3132 connection = _Connection ()
@@ -40,6 +41,7 @@ def test_ctor(self):
4041
4142 def test_current (self ):
4243 from gcloud .datastore .test_client import _NoCommitBatch
44+ from gcloud .datastore .test_batch import _Client
4345 _DATASET = 'DATASET'
4446 connection = _Connection ()
4547 client = _Client (_DATASET , connection )
@@ -65,6 +67,7 @@ def test_current(self):
6567 self .assertTrue (xact2 .current () is None )
6668
6769 def test_begin (self ):
70+ from gcloud .datastore .test_batch import _Client
6871 _DATASET = 'DATASET'
6972 connection = _Connection (234 )
7073 client = _Client (_DATASET , connection )
@@ -74,6 +77,7 @@ def test_begin(self):
7477 self .assertEqual (connection ._begun , _DATASET )
7578
7679 def test_begin_tombstoned (self ):
80+ from gcloud .datastore .test_batch import _Client
7781 _DATASET = 'DATASET'
7882 connection = _Connection (234 )
7983 client = _Client (_DATASET , connection )
@@ -88,6 +92,7 @@ def test_begin_tombstoned(self):
8892 self .assertRaises (ValueError , xact .begin )
8993
9094 def test_rollback (self ):
95+ from gcloud .datastore .test_batch import _Client
9196 _DATASET = 'DATASET'
9297 connection = _Connection (234 )
9398 client = _Client (_DATASET , connection )
@@ -98,6 +103,7 @@ def test_rollback(self):
98103 self .assertEqual (connection ._rolled_back , (_DATASET , 234 ))
99104
100105 def test_commit_no_auto_ids (self ):
106+ from gcloud .datastore .test_batch import _Client
101107 _DATASET = 'DATASET'
102108 connection = _Connection (234 )
103109 client = _Client (_DATASET , connection )
@@ -109,6 +115,7 @@ def test_commit_no_auto_ids(self):
109115 self .assertEqual (xact .id , None )
110116
111117 def test_commit_w_auto_ids (self ):
118+ from gcloud .datastore .test_batch import _Client
112119 _DATASET = 'DATASET'
113120 _KIND = 'KIND'
114121 _ID = 123
@@ -127,6 +134,7 @@ def test_commit_w_auto_ids(self):
127134 self .assertEqual (entity .key .path , [{'kind' : _KIND , 'id' : _ID }])
128135
129136 def test_context_manager_no_raise (self ):
137+ from gcloud .datastore .test_batch import _Client
130138 _DATASET = 'DATASET'
131139 connection = _Connection (234 )
132140 client = _Client (_DATASET , connection )
@@ -217,8 +225,3 @@ def _push_batch(self, batch):
217225
218226 def _pop_batch (self ):
219227 return self ._batches .pop (0 )
220-
221- @property
222- def current_batch (self ):
223- if self ._batches :
224- return self ._batches [0 ]
0 commit comments