code: def test_mtime(tempfile=None):
      url = url_2versions_nonversioned1_ver2
      with swallow_outputs():
          # without allow_old=False it might be reusing previous connection
          # which had already vcr tape for it, leading to failure.
          # TODO:  make allow_old configurable and then within tests disallow
          # allow_old
          get_test_providers(url).download(
              url, path=tempfile, allow_old_session=False
          )
      assert_equal(os.stat(tempfile).st_mtime, 1446873817)
  
      # and if url is wrong
      url = "s3://datalad-test0-versioned/nonexisting"
      assert_raises(
          DownloadError,
          get_test_providers(url).download,
          url,
          path=tempfile,
          overwrite=True,
      )
  
imports: import os
  from unittest.mock import patch
  import pytest
  from ...downloaders.base import DownloadError
  from ...support import path
  from ...support.exceptions import AccessDeniedError
  from ...tests.utils_pytest import SkipTest, assert_equal, assert_raises, integration, skip_if_no_module, skip_if_no_network, swallow_outputs, turtle, use_cassette, with_tempfile, with_testsui
  from ...utils import md5sum
  from ..providers import Providers
  from ..s3 import S3Authenticator, S3Downloader
  from .test_http import check_download_external_url
  from .utils import get_test_providers
label_desc: Use image node_id 2 for calling a global function with example usage: test_mtime(tempfile) without return types