| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | from vllm.transformers_utils.utils import ( |
| 4 | is_azure, |
| 5 | is_cloud_storage, |
| 6 | is_gcs, |
| 7 | is_s3, |
| 8 | ) |
| 9 | |
| 10 | |
| 11 | def test_is_gcs(): |
| 12 | assert is_gcs("gs://model-path") |
| 13 | assert not is_gcs("s3://model-path/path-to-model") |
| 14 | assert not is_gcs("/unix/local/path") |
| 15 | assert not is_gcs("nfs://nfs-fqdn.local") |
| 16 | |
| 17 | |
| 18 | def test_is_s3(): |
| 19 | assert is_s3("s3://model-path/path-to-model") |
| 20 | assert not is_s3("gs://model-path") |
| 21 | assert not is_s3("/unix/local/path") |
| 22 | assert not is_s3("nfs://nfs-fqdn.local") |
| 23 | |
| 24 | |
| 25 | def test_is_azure(): |
| 26 | assert is_azure("az://model-container/path") |
| 27 | assert not is_azure("s3://model-path/path-to-model") |
| 28 | assert not is_azure("/unix/local/path") |
| 29 | assert not is_azure("nfs://nfs-fqdn.local") |
| 30 | |
| 31 | |
| 32 | def test_is_cloud_storage(): |
| 33 | assert is_cloud_storage("gs://model-path") |
| 34 | assert is_cloud_storage("s3://model-path/path-to-model") |
| 35 | assert is_cloud_storage("az://model-container/path") |
| 36 | assert not is_cloud_storage("/unix/local/path") |
| 37 | assert not is_cloud_storage("nfs://nfs-fqdn.local") |