Spaces:
Running
Running
Download tests/test_python310_compat.py from basyx/MediaRouter: direct link, hf CLI and curl.
- Browser
- Download file 834 Bytes
-
https://huggingface.co/spaces/basyx/MediaRouter/resolve/refs%2Fpr%2F5/tests/test_python310_compat.py
- Command line
-
hf download hf://spaces/basyx/MediaRouter@refs/pr/5/tests/test_python310_compat.py
-
curl -L -o test_python310_compat.py https://huggingface.co/spaces/basyx/MediaRouter/resolve/refs%2Fpr%2F5/tests/test_python310_compat.py
834 Bytes
| """Regression tests for the Python 3.10 production runtime contract.""" | |
| from app.core.enums import StrEnum | |
| from app.social.domain.enums import JobStatus, Provider | |
| from app.social.schemas.tiktok import TikTokPrivacyLevel | |
| from app.social.schemas.youtube import YouTubePrivacyStatus | |
| def test_string_enums_do_not_require_python_311_stdlib() -> None: | |
| class Example(StrEnum): | |
| VALUE = "value" | |
| assert Example.VALUE == "value" | |
| assert str(Example.VALUE) == "value" | |
| assert f"{Example.VALUE}" == "value" | |
| assert Example.VALUE.value == "value" | |
| def test_social_schema_enums_keep_wire_values() -> None: | |
| assert str(Provider.TIKTOK) == "tiktok" | |
| assert str(JobStatus.PUBLISHED) == "published" | |
| assert str(TikTokPrivacyLevel.SELF_ONLY) == "SELF_ONLY" | |
| assert str(YouTubePrivacyStatus.PRIVATE) == "private" | |