code: def test_write_to_datastore(self):
      self.reset_work_pieces()
      self.work_pieces.work["w1"] = self.work1
      self.work_pieces.work["w2"] = self.work2
      self.work_pieces.write_all_to_datastore()
      # verify content of the datastore
      parent_key = fake_cloud_client.FakeDatastoreKey(
          work_data.KIND_WORK_TYPE, TEST_WORK_TYPE_ENTITY_ID
      )
      assertCountEqual(
          self,
          [fake_cloud_client.make_entity(parent_key)],
          self.datastore_client.query_fetch(
              kind=work_data.KIND_WORK_TYPE
          ),
      )
      entity1 = fake_cloud_client.make_entity(
          fake_cloud_client.FakeDatastoreKey(
              work_data.KIND_WORK, "w1", parent=parent_key
          )
      )
      entity1.update(self.work1)
      entity2 = fake_cloud_client.make_entity(
          fake_cloud_client.FakeDatastoreKey(
              work_data.KIND_WORK, "w2", parent=parent_key
          )
      )
      entity2.update(self.work2)
      assertCountEqual(
          self,
          [entity1, entity2],
          self.datastore_client.query_fetch(kind=work_data.KIND_WORK),
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import unittest
  from six import assertCountEqual
  from six import itervalues
  from eval_lib import work_data
  from eval_lib.tests import fake_cloud_client
label_desc: Use image node_id 4 for calling the WorkPiecesBaseTest obj's underlying member method code with example usage: obj.test_write_to_datastore() without return types