mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-11 12:16:58 +03:00
14 lines
351 B
Python
14 lines
351 B
Python
|
import collections
|
||
|
from graphql.core.type import GraphQLEnumType
|
||
|
from graphene.utils.misc import enum_to_graphql_enum
|
||
|
|
||
|
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)
|