Spaces:
Running
Running
| """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" | |