mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-23 01:56:54 +03:00
Improved testing
This commit is contained in:
parent
32e4a21403
commit
6f6762180d
|
@ -39,7 +39,7 @@ schema = object()
|
||||||
|
|
||||||
def test_interface():
|
def test_interface():
|
||||||
object_type = Character.internal_type(schema)
|
object_type = Character.internal_type(schema)
|
||||||
assert Character._meta.interface == True
|
assert Character._meta.interface is True
|
||||||
assert isinstance(object_type, GraphQLInterfaceType)
|
assert isinstance(object_type, GraphQLInterfaceType)
|
||||||
assert Character._meta.type_name == 'core.Character'
|
assert Character._meta.type_name == 'core.Character'
|
||||||
assert object_type.description == 'Character description'
|
assert object_type.description == 'Character description'
|
||||||
|
@ -54,13 +54,14 @@ def test_interface_resolve_type():
|
||||||
|
|
||||||
def test_object_type():
|
def test_object_type():
|
||||||
object_type = Human.internal_type(schema)
|
object_type = Human.internal_type(schema)
|
||||||
assert Human._meta.interface == False
|
assert Human._meta.interface is False
|
||||||
assert Human._meta.type_name == 'core.Human'
|
assert Human._meta.type_name == 'core.Human'
|
||||||
assert isinstance(object_type, GraphQLObjectType)
|
assert isinstance(object_type, GraphQLObjectType)
|
||||||
assert object_type.description == 'Human description'
|
assert object_type.description == 'Human description'
|
||||||
assert object_type.get_fields() == {'name': Character._meta.fields_map['name'].internal_field(
|
assert object_type.get_fields() == {'name': Human._meta.fields_map['name'].internal_field(
|
||||||
schema), 'friends': Human._meta.fields_map['friends'].internal_field(schema)}
|
schema), 'friends': Human._meta.fields_map['friends'].internal_field(schema)}
|
||||||
assert object_type.get_interfaces() == [Character.internal_type(schema)]
|
assert object_type.get_interfaces() == [Character.internal_type(schema)]
|
||||||
|
assert Human._meta.fields_map['name'].object_type == Human
|
||||||
|
|
||||||
|
|
||||||
def test_field_clashes():
|
def test_field_clashes():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user