code: def test_kv_store_partition_update(
      root_verify_key, kv_store_partition: KeyValueStorePartition
  ) -> None:
      # add item
      obj = MockSyftObject(data=1)
      kv_store_partition.set(
          root_verify_key, obj, ignore_duplicates=False
      )
      assert len(kv_store_partition.all(root_verify_key).ok()) == 1
  
      # fail to update missing keys
      rand_obj = MockSyftObject(data="bogus")
      key = kv_store_partition.settings.store_key.with_obj(rand_obj)
      res = kv_store_partition.update(root_verify_key, key, obj)
      assert res.is_err()
  
      # update the key multiple times
      for v in range(10):
          key = kv_store_partition.settings.store_key.with_obj(obj)
          obj_new = MockSyftObject(data=v)
  
          res = kv_store_partition.update(
              root_verify_key, key, copy(obj_new)
          )
          assert res.is_ok()
  
          # The ID should stay the same on update, unly the values are updated.
          assert len(kv_store_partition.all(root_verify_key).ok()) == 1
          assert (
              kv_store_partition.all(root_verify_key).ok()[0].id
              == obj.id
          )
          assert (
              kv_store_partition.all(root_verify_key).ok()[0].id
              != obj_new.id
          )
          assert (
              kv_store_partition.all(root_verify_key).ok()[0].data == v
          )
  
          stored = kv_store_partition.get_all_from_store(
              root_verify_key, QueryKeys(qks=[key])
          )
          assert stored.ok()[0].data == v
  
file_path: PySyft/packages/syft/tests/syft/stores/kv_document_store_test.py
imports: from copy import copy
  from threading import Thread
  import pytest
  from syft.store.document_store import PartitionSettings
  from syft.store.document_store import QueryKeys
  from syft.store.kv_document_store import KeyValueStorePartition
  from .store_mocks_test import MockObjectType
  from .store_mocks_test import MockStoreConfig
  from .store_mocks_test import MockSyftObject
label_desc: Use image node_id 8 for calling a global function with example usage: test_kv_store_partition_update(root_verify_key, kv_store_partition) without return types