mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-26 03:23:55 +03:00
Improved test syntax
This commit is contained in:
parent
24cd190f95
commit
00c9cc95d4
|
@ -1,6 +1,7 @@
|
|||
from graphql.core.type import GraphQLEnumValue
|
||||
|
||||
import graphene
|
||||
from graphene import resolve_only_args
|
||||
from graphql.core.type import GraphQLEnumValue
|
||||
|
||||
from .data import get_character, get_droid, get_hero, get_human
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from py.test import raises
|
||||
from django.db import models
|
||||
from py.test import raises
|
||||
|
||||
import graphene
|
||||
from graphene.contrib.django.converter import convert_django_field
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
from mock import patch
|
||||
|
||||
from graphql.core.type import GraphQLInterfaceType, GraphQLObjectType
|
||||
from mock import patch
|
||||
|
||||
from graphene import Schema
|
||||
from graphene.contrib.django.types import DjangoInterface, DjangoNode
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
import inspect
|
||||
from collections import OrderedDict
|
||||
|
||||
from graphene import signals
|
||||
from graphql.core.execution.executor import Executor
|
||||
from graphql.core.execution.middlewares.sync import \
|
||||
SynchronousExecutionMiddleware
|
||||
from graphql.core.type import GraphQLSchema as _GraphQLSchema
|
||||
from graphql.core.utils.introspection_query import introspection_query
|
||||
|
||||
from graphene import signals
|
||||
|
||||
from .types.base import BaseType
|
||||
from .types.objecttype import BaseObjectType
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
from graphql.core.type import (GraphQLBoolean, GraphQLField, GraphQLFloat,
|
||||
GraphQLID, GraphQLInt, GraphQLNonNull,
|
||||
GraphQLString)
|
||||
from py.test import raises
|
||||
|
||||
from graphene.core.fields import (BooleanField, Field, FloatField, IDField,
|
||||
IntField, NonNullField, StringField)
|
||||
from graphene.core.schema import Schema
|
||||
from graphene.core.types import ObjectType
|
||||
from graphql.core.type import (GraphQLBoolean, GraphQLField, GraphQLFloat,
|
||||
GraphQLID, GraphQLInt, GraphQLNonNull,
|
||||
GraphQLString)
|
||||
|
||||
|
||||
class MyOt(ObjectType):
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
|
||||
|
||||
from graphql.core import graphql
|
||||
from graphql.core.type import GraphQLSchema
|
||||
|
||||
from graphene.core.fields import Field
|
||||
from graphene.core.schema import Schema
|
||||
from graphene.core.types import Interface, List, ObjectType, String
|
||||
from graphql.core import graphql
|
||||
from graphql.core.type import GraphQLSchema
|
||||
|
||||
|
||||
class Character(Interface):
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from graphql.core import graphql
|
||||
from py.test import raises
|
||||
|
||||
from graphene import Interface, List, ObjectType, Schema, String
|
||||
from graphene.core.fields import Field
|
||||
from graphene.core.types.base import LazyType
|
||||
from graphql.core import graphql
|
||||
from tests.utils import assert_equal_lists
|
||||
|
||||
schema = Schema(name='My own schema')
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import six
|
||||
|
||||
from graphql.core.type import GraphQLList, GraphQLNonNull
|
||||
|
||||
from .base import LazyType, MountedType, MountType
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from collections import OrderedDict
|
||||
|
||||
import six
|
||||
|
||||
from graphql.core.type import GraphQLField, GraphQLInputObjectField
|
||||
|
||||
from ...utils import to_camel_case
|
||||
|
|
|
@ -4,11 +4,11 @@ from collections import OrderedDict
|
|||
from functools import partial
|
||||
|
||||
import six
|
||||
|
||||
from graphene import signals
|
||||
from graphql.core.type import (GraphQLInputObjectType, GraphQLInterfaceType,
|
||||
GraphQLObjectType, GraphQLUnionType)
|
||||
|
||||
from graphene import signals
|
||||
|
||||
from ..exceptions import SkipField
|
||||
from ..options import Options
|
||||
from .argument import ArgumentsGroup
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from graphql.core.type import GraphQLArgument
|
||||
from pytest import raises
|
||||
|
||||
from graphene.core.schema import Schema
|
||||
from graphene.core.types import ObjectType
|
||||
from graphql.core.type import GraphQLArgument
|
||||
|
||||
from ..argument import Argument, snake_case_args, to_arguments
|
||||
from ..scalars import String
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from graphene.core.schema import Schema
|
||||
from graphql.core.type import GraphQLList, GraphQLNonNull, GraphQLString
|
||||
|
||||
from graphene.core.schema import Schema
|
||||
|
||||
from ..definitions import List, NonNull
|
||||
from ..scalars import String
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from graphene.core.schema import Schema
|
||||
from graphene.core.types import InputObjectType, ObjectType
|
||||
from graphql.core.type import (GraphQLField, GraphQLInputObjectField,
|
||||
GraphQLString)
|
||||
|
||||
from graphene.core.schema import Schema
|
||||
from graphene.core.types import InputObjectType, ObjectType
|
||||
|
||||
from ..base import LazyType
|
||||
from ..definitions import List
|
||||
from ..field import Field, InputField
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
from py.test import raises
|
||||
|
||||
from graphene.core.schema import Schema
|
||||
from graphene.core.types import Int, Interface, String
|
||||
from graphql.core.execution.middlewares.utils import (resolver_has_tag,
|
||||
tag_resolver)
|
||||
from graphql.core.type import (GraphQLInterfaceType, GraphQLObjectType,
|
||||
GraphQLUnionType)
|
||||
from py.test import raises
|
||||
|
||||
from graphene.core.schema import Schema
|
||||
from graphene.core.types import Int, Interface, String
|
||||
|
||||
|
||||
class Character(Interface):
|
||||
|
@ -38,12 +38,10 @@ class Human(Character):
|
|||
|
||||
class Droid(Character):
|
||||
'''Droid description'''
|
||||
pass
|
||||
|
||||
|
||||
class CharacterType(Droid, Human):
|
||||
'''Union Type'''
|
||||
pass
|
||||
|
||||
schema = Schema()
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from graphene.core.schema import Schema
|
||||
from graphql.core.type import (GraphQLBoolean, GraphQLFloat, GraphQLID,
|
||||
GraphQLInt, GraphQLScalarType, GraphQLString)
|
||||
|
||||
from graphene.core.schema import Schema
|
||||
|
||||
from ..scalars import ID, Boolean, Float, Int, Scalar, String
|
||||
|
||||
schema = Schema()
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from graphql.core.type import GraphQLInputObjectField
|
||||
|
||||
import graphene
|
||||
from graphene import relay
|
||||
from graphene.core.schema import Schema
|
||||
from graphql.core.type import GraphQLInputObjectField
|
||||
|
||||
my_id = 0
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from graphql.core.type import GraphQLID, GraphQLNonNull
|
||||
|
||||
import graphene
|
||||
from graphene import relay
|
||||
from graphql.core.type import GraphQLID, GraphQLNonNull
|
||||
|
||||
schema = graphene.Schema()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user