code: def test_store(tmpdir: "Path"):
      store = DummyStore(tmpdir)
  
      open(os.path.join(tmpdir, ".DS_store"), "a", encoding="utf-8")
  
      DummyItem.store = store
      oldtime = datetime.now()
      DummyItem.create("test:version1")
      time.sleep(1)
      DummyItem.create("test:otherprefix")
      time.sleep(1)
      DummyItem.create(Tag("test", "version2"))
      time.sleep(1)
      DummyItem.create("test:version3", creation_time=oldtime)
      time.sleep(1)
      DummyItem.create("test1:version1")
      with pytest.raises(BentoMLException):
          DummyItem.create("test:version2")
  
      item = store.get("test:version1")
      assert item.tag == Tag("test", "version1")
      item = store.get("test:oth")
      assert item.tag == Tag("test", "otherprefix")
      latest = store.get("test:latest")
      assert latest.tag == Tag("test", "version2")
      latest = store.get("test")
      assert latest.tag == Tag("test", "version2")
  
      with pytest.raises(BentoMLException):
          store.get("test:ver")
  
      with pytest.raises(NotFound):
          store.get("nonexistent:latest")
      with pytest.raises(NotFound):
          store.get("test:version4")
  
      vers = store.list()
      assert set([ver.tag for ver in vers]) == {
          Tag("test", "version1"),
          Tag("test", "version2"),
          Tag("test", "version3"),
          Tag("test", "otherprefix"),
          Tag("test1", "version1"),
      }
  
      vers = store.list("test")
      assert set([ver.tag for ver in vers]) == {
          Tag("test", "version1"),
          Tag("test", "version2"),
          Tag("test", "version3"),
          Tag("test", "otherprefix"),
      }
  
      vers = store.list("test:version1")
      assert set([ver.tag for ver in vers]) == {Tag("test", "version1")}
  
      assert store.list("nonexistent:latest") == []
      assert store.list("test:version4") == []
  
      store.delete("test:version2")
      latest = store.get("test")
      assert latest.tag == Tag("test", "otherprefix")
  
      with pytest.raises(NotFound):
          store.delete("test:version4")
  
      store.delete("test1:version1")
  
      with pytest.raises(NotFound):
          store.get("test1")
  
      with pytest.raises(NotFound):
          store.list("test1")
  
      store.delete("test")
  
      with pytest.raises(NotFound):
          store.list("test")
  
      assert store.list() == []
  
imports: import os
  import sys
  import time
  import typing
  from datetime import datetime
  from typing import TYPE_CHECKING
  import attr
  import fs
  import pytest
  from bentoml import Tag
  from bentoml._internal.store import Store
  from bentoml._internal.store import StoreItem
  from bentoml.exceptions import BentoMLException
  from bentoml.exceptions import NotFound
label_desc: Use image node_id 1 for calling a global function with example usage: test_store(tmpdir) without return types