Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /DeepselSystems_deepsel /tests /test_graphql_schema.py
| import pytest | |
| # import deepsel.utils first to avoid circular-import quirk during collection | |
| from deepsel.utils.models_pool import models_pool # noqa: F401 | |
| from strawberry.scalars import JSON | |
| from deepsel.utils.graphql_schema import ( | |
| AutoGraphQLFactory, | |
| OperatorEnum, | |
| OrderDirectionEnum, | |
| get_graphql_type_from_sqlalchemy_type, | |
| ) | |
| class TestTypeMapping: | |
| def test_known_types(self, sa_type, expected): | |
| gql_type, is_optional = get_graphql_type_from_sqlalchemy_type(sa_type) | |
| assert gql_type is expected | |
| assert is_optional is True | |
| def test_unknown_type_falls_back_to_str(self): | |
| gql_type, is_optional = get_graphql_type_from_sqlalchemy_type("CUSTOMTYPE") | |
| assert gql_type is str | |
| assert is_optional is True | |
| def test_case_insensitive(self): | |
| assert get_graphql_type_from_sqlalchemy_type("integer")[0] is int | |
| class TestEnums: | |
| def test_operator_enum_values(self): | |
| assert OperatorEnum.EQ.value == "=" | |
| assert OperatorEnum.ILIKE.value == "ilike" | |
| assert OperatorEnum.BETWEEN.value == "between" | |
| def test_order_direction_values(self): | |
| assert OrderDirectionEnum.ASC.value == "asc" | |
| assert OrderDirectionEnum.DESC.value == "desc" | |
| class TestFactoryInit: | |
| def test_starts_with_empty_caches(self): | |
| factory = AutoGraphQLFactory() | |
| assert factory.generated_types == {} | |
| assert factory.generated_input_types == {} | |
| assert factory.generated_resolvers == {} | |
| assert factory.processing_input_types == set() | |
Xet Storage Details
- Size:
- 2.05 kB
- Xet hash:
- 8e0360a13b97112d6d061c13a413455902224a4a52d827dea2c7165644e662cf
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.