code: def test_snapshot_invalid_file_uri():
      # Invalid file:// host
      response = request_with_validation(
          api="/collections/{collection_name}/snapshots/recover",
          method="PUT",
          path_params={"collection_name": "somethingthatdoesnotexist"},
          body={
              "location": "file://whatever.snapshot",
          },
      )
      assert response.status_code == 400
      assert (
          response.json()["status"]["error"]
          == "Bad request: Invalid snapshot URI, file path must be absolute or on localhost"
      )
  
      # Absolute path that does not exist
      response = request_with_validation(
          api="/collections/{collection_name}/snapshots/recover",
          method="PUT",
          path_params={"collection_name": "somethingthatdoesnotexist"},
          body={
              "location": "file:///whatever.snapshot",
          },
      )
      assert response.status_code == 400
      assert (
          response.json()["status"]["error"]
          == 'Bad request: Snapshot file "/whatever.snapshot" does not exist'
      )
  
      # Path that does not exist
      response = request_with_validation(
          api="/collections/{collection_name}/snapshots/recover",
          method="PUT",
          path_params={"collection_name": "somethingthatdoesnotexist"},
          body={
              "location": "file://localhost/whatever.snapshot",
          },
      )
      assert response.status_code == 400
      assert (
          response.json()["status"]["error"]
          == 'Bad request: Snapshot file "/whatever.snapshot" does not exist'
      )
  
imports: from time import sleep
  import pytest
  from .helpers.collection_setup import basic_collection_setup, drop_collection
  from .helpers.helpers import request_with_validation
label_desc: Use image node_id 4 for calling a global function with example usage: test_snapshot_invalid_file_uri() without return types