mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-27 08:19:45 +03:00
added partial test for dynamic
This commit is contained in:
parent
b1dbcedd6b
commit
0fe2fe3031
|
@ -1,3 +1,4 @@
|
||||||
|
from functools import partial
|
||||||
from ..dynamic import Dynamic
|
from ..dynamic import Dynamic
|
||||||
from ..scalars import String
|
from ..scalars import String
|
||||||
from ..structures import List, NonNull
|
from ..structures import List, NonNull
|
||||||
|
@ -25,3 +26,11 @@ def test_list_non_null():
|
||||||
dynamic = Dynamic(lambda: List(NonNull(String)))
|
dynamic = Dynamic(lambda: List(NonNull(String)))
|
||||||
assert dynamic.get_type().of_type.of_type == String
|
assert dynamic.get_type().of_type.of_type == String
|
||||||
assert str(dynamic.get_type()) == '[String!]'
|
assert str(dynamic.get_type()) == '[String!]'
|
||||||
|
|
||||||
|
|
||||||
|
def test_partial():
|
||||||
|
def __type(_type):
|
||||||
|
return _type
|
||||||
|
dynamic = Dynamic(partial(__type(String)))
|
||||||
|
assert dynamic.get_type() == String
|
||||||
|
assert str(dynamic.get_type()) == 'String'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user