Refactored decorators into utils

This commit is contained in:
Syrus Akbary 2015-11-13 19:44:01 -08:00
parent dfc2bc4ac3
commit bebdf5cf9b
4 changed files with 13 additions and 2 deletions

View File

@ -37,7 +37,7 @@ from graphene.core.fields import (
FloatField,
)
from graphene.decorators import (
from graphene.utils import (
resolve_only_args
)

View File

@ -3,6 +3,9 @@ from .proxy_snake_dict import ProxySnakeDict
from .caching import cached_property, memoize
from .lazymap import LazyMap
from .misc import enum_to_graphql_enum
from .resolve_only_args import resolve_only_args
__all__ = ['to_camel_case', 'to_snake_case', 'ProxySnakeDict',
'cached_property', 'memoize', 'LazyMap', 'enum_to_graphql_enum']
'cached_property', 'memoize', 'LazyMap', 'enum_to_graphql_enum',
'resolve_only_args']

View File

@ -0,0 +1,8 @@
from ..resolve_only_args import resolve_only_args
def test_resolve_only_args():
my_data = {'one': 1, 'two': 2}
resolver = lambda *args, **kwargs: kwargs
wrapped = resolve_only_args(resolver)
assert wrapped(None, my_data, None) == my_data