graphene/tests/utils/test_misc.py
2015-10-29 23:27:41 -07:00

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)