| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -405,16 +405,15 @@ def delete_entities(self, dataset_id, key_pbs): | |||
| 405 | 405 | ||
| 406 | 406 | :rtype: boolean (if in a transaction) or else | |
| 407 | 407 | :class:`gcloud.datastore.datastore_v1_pb2.MutationResult`. | |
| 408 | - :returns: True (if in a transaction) or else a mutation result | ||
| 409 | - protobuf. | ||
| 408 | + :returns: True | ||
| 410 | 409 | """ | |
| 411 | 410 | mutation = self.mutation() | |
| 412 | 411 | ||
| 413 | 412 | for key_pb in key_pbs: | |
| 414 | 413 | delete = mutation.delete.add() | |
| 415 | 414 | delete.CopyFrom(key_pb) | |
| 416 | 415 | ||
| 417 | - if self.transaction(): | ||
| 418 | - return True | ||
| 419 | - else: | ||
| 420 | - return self.commit(dataset_id, mutation) | ||
| 416 | + if not self.transaction(): | ||
| 417 | + self.commit(dataset_id, mutation) | ||
| 418 | + | ||
| 419 | + return True | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -778,8 +778,7 @@ def test_delete_entities_wo_transaction(self): | |||
| 778 | 778 | ]) | |
| 779 | 779 | http = conn._http = Http({'status': '200'}, rsp_pb.SerializeToString()) | |
| 780 | 780 | result = conn.delete_entities(DATASET_ID, [key_pb]) | |
| 781 | - self.assertEqual(result.index_updates, 0) | ||
| 782 | - self.assertEqual(list(result.insert_auto_id_key), []) | ||
| 781 | + self.assertEqual(result, True) | ||
| 783 | 782 | cw = http._called_with | |
| 784 | 783 | self.assertEqual(cw['uri'], URI) | |
| 785 | 784 | self.assertEqual(cw['method'], 'POST') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments