mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-29 21:13:58 +03:00
16 lines
361 B
Python
16 lines
361 B
Python
import collections
|
|
|
|
from graphene.utils.misc import enum_to_graphql_enum
|
|
from graphql.core.type import GraphQLEnumType
|
|
|
|
item = collections.namedtuple('type', 'name value')
|
|
|
|
|
|
class MyCustomEnum(list):
|
|
__name__ = 'MyName'
|
|
|
|
|
|
def test_enum_to_graphql_enum():
|
|
assert isinstance(enum_to_graphql_enum(
|
|
MyCustomEnum([item('k', 'v')])), GraphQLEnumType)
|