示例#1
0
def test_attempt_bind_custom_enum_to_undefined_type_raises_error(
        schema_with_enum):
    graphql_enum = EnumType("Undefined", {})
    with pytest.raises(ValueError):
        graphql_enum.bind_to_schema(schema_with_enum)
示例#2
0
def test_attempt_bind_custom_enum_to_wrong_schema_type_raises_error(
        schema_with_enum):
    graphql_enum = EnumType("Query", {})
    with pytest.raises(ValueError):
        graphql_enum.bind_to_schema(schema_with_enum)
示例#3
0
def test_attempt_bind_custom_enum_to_schema_enum_missing_value_raises_error(
        schema_with_enum):
    graphql_enum = EnumType("Episode", {"JARJAR": 1999})
    with pytest.raises(ValueError):
        graphql_enum.bind_to_schema(schema_with_enum)  # pylint: disable=no-member