/
niceSOFT
/
python3-hatchling
Обзор
Документация
Войти
/
niceSOFT
/
python3-hatchling
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/project/test_utils.py
49 строк
1 KB
Dimitri Papadopoulos Orfanos
Upgrade Ruff to 0.13.2 (#1890)
28 сен 2025, 21:20
Не верифицирован
28 сен 2025, 21:20
aff6f39
Код
Авторство
О чём код?
import pytest from hatch.project.utils import parse_inline_script_metadata class TestParseInlineScriptMetadata: def test_no_metadata(self): assert parse_inline_script_metadata("") is None def test_too_many_blocks(self, helpers): script = helpers.dedent( """ # /// script # dependencies = ["foo"] # /// # /// script # dependencies = ["foo"] # /// """ ) with pytest.raises(ValueError, match="^Multiple inline metadata blocks found for type: script$"): parse_inline_script_metadata(script) def test_correct(self, helpers): script = helpers.dedent( """ # /// script # embedded-csharp = ''' # /// <summary> # /// text # /// # /// </summary> # public class MyClass { } # ''' # /// """ ) assert parse_inline_script_metadata(script) == { "embedded-csharp": helpers.dedent( """ /// <summary> /// text /// /// </summary> public class MyClass { } """ ), }