26 lines
782 B
Python
26 lines
782 B
Python
"""Тесты materialize_wheelhouse_sdists.py."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import tempfile
|
|
import unittest
|
|
from pathlib import Path
|
|
from unittest.mock import patch
|
|
|
|
from scripts.materialize_wheelhouse_sdists import materialize_sdists
|
|
|
|
|
|
class MaterializeWheelhouseSdistsTests(unittest.TestCase):
|
|
def test_no_sdists_is_noop(self) -> None:
|
|
with tempfile.TemporaryDirectory() as tmp:
|
|
wheels = Path(tmp)
|
|
(wheels / "flask-2.3.3-py3-none-any.whl").write_bytes(b"1")
|
|
with patch("scripts.materialize_wheelhouse_sdists.subprocess.run") as run:
|
|
built = materialize_sdists(wheels, "python3")
|
|
self.assertEqual(built, [])
|
|
run.assert_not_called()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|