| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | """Unit tests for loading custom logits processors by FQCN. |
| 4 | |
| 5 | Kept separate from `test_custom_offline.py`, which runs end-to-end against a |
| 6 | downloaded model; these exercise the loader alone and need no model. |
| 7 | """ |
| 8 | |
| 9 | import pytest |
| 10 | |
| 11 | from vllm.v1.sample.logits_processor import _load_logitsprocs_by_fqcns |
| 12 | |
| 13 | |
| 14 | @pytest.mark.parametrize( |
| 15 | "fqcn", |
| 16 | [ |
| 17 | "invalid_fqcn_without_colon", |
| 18 | "invalid:fqcn:with:multiple:colons", |
| 19 | ], |
| 20 | ids=["missing-colon", "too-many-colons"], |
| 21 | ) |
| 22 | def test_invalid_fqcn_rejected(fqcn: str): |
| 23 | with pytest.raises(ValueError, match="Invalid logits processor FQCN"): |
| 24 | _load_logitsprocs_by_fqcns([fqcn]) |