repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
graphql-python/gql | e53b168f463b62bc7f577d785f6ed0c72acc03bd | 110 | train | train | tests/test_websocket_subscription.py | test_websocket_subscription_sync_graceful_shutdown | assert | numeric_literal | 186 | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from graphql import ExecutionResult
from parse import search
from gql import Client, gql
from gql.transport.exceptions import TransportServerError
from .conftest import MS, WebSocketServerHelper
pytestmark = pytest.mark.webs... | 4 | e53b168f463b62bc7f577d785f6ed0c72acc03bd | 110 | v2_extractor_at_anchor |
graphql-python/gql | e53b168f463b62bc7f577d785f6ed0c72acc03bd | 110 | train | train | tests/test_websocket_subscription.py | test_websocket_subscription | assert | numeric_literal | 131 | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from graphql import ExecutionResult
from parse import search
from gql import Client, gql
from gql.transport.exceptions import TransportServerError
from .conftest import MS, WebSocketServerHelper
pytestmark = pytest.mark.webs... | -1 | e53b168f463b62bc7f577d785f6ed0c72acc03bd | 110 | v2_extractor_at_anchor |
graphql-python/gql | e53b168f463b62bc7f577d785f6ed0c72acc03bd | 110 | train | train | tests/test_websocket_subscription.py | test_websocket_subscription | assert | variable | 128 | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from graphql import ExecutionResult
from parse import search
from gql import Client, gql
from gql.transport.exceptions import TransportServerError
from .conftest import MS, WebSocketServerHelper
pytestmark = pytest.mark.webs... | count | e53b168f463b62bc7f577d785f6ed0c72acc03bd | 110 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/tests/issues/test_425.py | test_special_objecttype_inherit_meta_options | assert | collection | 12 | from graphene.types.enum import Enum, EnumOptions
from graphene.types.inputobjecttype import InputObjectType
from graphene.types.objecttype import ObjectType, ObjectTypeOptions
def test_special_objecttype_inherit_meta_options():
class MyType(SpecialObjectType):
pass
assert MyType._meta.name == "MyType... | () | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_abstracttype.py | test_generate_objecttype_inherit_abstracttype | assert | collection | 16 | from .. import abstracttype
from ..abstracttype import AbstractType
from ..field import Field
from ..objecttype import ObjectType
from ..unmountedtype import UnmountedType
def test_generate_objecttype_inherit_abstracttype():
class MyAbstractType(AbstractType):
field1 = MyScalar()
class MyObjectType(Ob... | () | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_inputobjecttype.py | test_generate_inputobjecttype | assert | collection | 17 | from ..argument import Argument
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..objecttype import ObjectType
from ..scalars import Boolean, String
from ..schema import Schema
from ..unmountedtype import UnmountedType
def test_generate_inputobjecttype()... | {} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_interface.py | test_generate_interface | assert | collection | 12 | from ..field import Field
from ..interface import Interface
from ..unmountedtype import UnmountedType
def test_generate_interface():
class MyInterface(Interface):
"""Documentation"""
assert MyInterface._meta.name == "MyInterface"
assert MyInterface._meta.description == "Documentation"
assert ... | {} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_objecttype.py | test_generate_objecttype | assert | collection | 19 | import pytest
from ..field import Field
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
from ..unmountedtype import UnmountedType
def test_generate_objecttype():
class MyObjectType(ObjectType):
... | {} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_objecttype.py | test_generate_objecttype_inherit_abstracttype | assert | collection | 20 | import pytest
from ..field import Field
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
from ..unmountedtype import UnmountedType
def test_generate_objecttype_inherit_abstracttype():
class MyAbstractTyp... | () | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/utils/tests/test_annotate.py | test_annotate_with_no_params | assert | collection | 14 | import pytest
from ..annotate import annotate
def func(a, b, *c, **d):
pass
def func_with_annotations(a, b, *c, **d):
pass
def test_annotate_with_no_params():
annotated_func = annotate(func, _trigger_warning=False)
assert annotated_func.__annotations__ == | {} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_objecttype.py | test_objecttype_with_possible_types | assert | collection | 17 | import pytest
from ..field import Field
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
from ..unmountedtype import UnmountedType
def test_objecttype_with_possible_types():
class MyObjectType(ObjectType... | (dict,) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_mutation.py | test_mutation | assert | collection | 25 | import pytest
from promise import Promise
from ...types import (
ID,
Argument,
Field,
InputField,
InputObjectType,
NonNull,
ObjectType,
Schema,
)
from ...types.scalars import String
from ..mutation import ClientIDMutation
def test_mutation():
fields = SaySomething._meta.fields
... | ["input"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_objecttype.py | test_generate_objecttype_with_meta | assert | collection | 21 | import pytest
from ..field import Field
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
from ..unmountedtype import UnmountedType
def test_generate_objecttype_with_meta():
class MyObjectType(ObjectType)... | (MyType,) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_typemap.py | test_objecttype_camelcase | assert | collection | 40 | import pytest
from graphql.type import (
GraphQLArgument,
GraphQLEnumType,
GraphQLEnumValue,
GraphQLField,
GraphQLInputObjectField,
GraphQLInputObjectType,
GraphQLInterfaceType,
GraphQLObjectType,
GraphQLString,
)
from ..dynamic import Dynamic
from ..enum import Enum
from ..field im... | ["fooBar"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_typemap.py | test_objecttype_camelcase_disabled | assert | collection | 40 | import pytest
from graphql.type import (
GraphQLArgument,
GraphQLEnumType,
GraphQLEnumValue,
GraphQLField,
GraphQLInputObjectField,
GraphQLInputObjectType,
GraphQLInterfaceType,
GraphQLObjectType,
GraphQLString,
)
from ..dynamic import Dynamic
from ..enum import Enum
from ..field im... | ["foo_bar"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/utils/tests/test_resolve_only_args.py | test_resolve_only_args | assert | collection | 14 | from .. import deprecated
from ..resolve_only_args import resolve_only_args
def test_resolve_only_args(mocker):
mocker.patch.object(deprecated, "warn_deprecation")
def resolver(root, **args):
return root, args
wrapped_resolver = resolve_only_args(resolver)
assert deprecated.warn_deprecation.c... | (1, {"a": 3}) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_node.py | test_node_requesting_non_node | assert | collection | 13 | from collections import OrderedDict
from graphql_relay import to_global_id
from ...types import ObjectType, Schema, String
from ..node import Node, is_node
def test_node_requesting_non_node():
executed = schema.execute(
'{ node(id:"%s") { __typename } } ' % Node.to_global_id("RootQuery", 1)
)
as... | {"node": None} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_abstracttype.py | test_generate_objecttype_inherit_abstracttype | assert | collection | 19 | from .. import abstracttype
from ..abstracttype import AbstractType
from ..field import Field
from ..objecttype import ObjectType
from ..unmountedtype import UnmountedType
def test_generate_objecttype_inherit_abstracttype():
class MyAbstractType(AbstractType):
field1 = MyScalar()
class MyObjectType(Ob... | [Field, Field] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_interface.py | test_generate_interface_inherit_abstracttype | assert | collection | 14 | from ..field import Field
from ..interface import Interface
from ..unmountedtype import UnmountedType
def test_generate_interface_inherit_abstracttype():
class MyAbstractType(object):
field1 = MyScalar()
class MyInterface(Interface, MyAbstractType):
field2 = MyScalar()
assert list(MyInter... | [Field, Field] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_mountedtype.py | test_mounted_type_custom | assert | collection | 10 | from ..field import Field
from ..scalars import String
def test_mounted_type_custom():
unmounted = String(metadata={"hey": "yo!"})
mounted = CustomField.mounted(unmounted)
assert isinstance(mounted, CustomField)
assert mounted.type == String
assert mounted.metadata == | {"hey": "yo!"} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/utils/tests/test_deduplicator.py | test_does_not_modify_object_without_typename_and_id | assert | collection | 13 | import datetime
import graphene
from graphene import relay
from graphene.types.resolver import dict_resolver
from ..deduplicator import deflate
def test_does_not_modify_object_without_typename_and_id():
response = {"foo": "bar"}
deflated_response = deflate(response)
assert deflated_response == | {"foo": "bar"} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_field.py | test_field_source_argument_as_kw | assert | collection | 15 | from functools import partial
import pytest
from ..argument import Argument
from ..field import Field
from ..scalars import String
from ..structures import NonNull
from .utils import MyLazyType
def test_field_source_argument_as_kw():
MyType = object()
field = Field(MyType, b=NonNull(True), c=Argument(None), ... | ["b", "c", "a"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_query.py | test_query_wrong_default_value | assert | collection | 38 | import json
from functools import partial
from graphql import GraphQLError, ResolveInfo, Source, execute, parse
from ..context import Context
from ..dynamic import Dynamic
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from... | {"hello": None} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_inputobjecttype.py | test_inputobjecttype_of_input | assert | collection | 40 | from ..argument import Argument
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..objecttype import ObjectType
from ..scalars import Boolean, String
from ..schema import Schema
from ..unmountedtype import UnmountedType
def test_inputobjecttype_of_input()... | {"isChild": True} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_mutation.py | test_generate_mutation_no_args | assert | collection | 23 | import pytest
from ..argument import Argument
from ..dynamic import Dynamic
from ..mutation import Mutation
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
def test_generate_mutation_no_args():
class MyMutation(Mutation):
"""Doc... | {"name": "Peter"} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_node.py | test_node_field_only_type_wrong | assert | collection | 16 | from collections import OrderedDict
from graphql_relay import to_global_id
from ...types import ObjectType, Schema, String
from ..node import Node, is_node
def test_node_field_only_type_wrong():
executed = schema.execute(
'{ onlyNode(id:"%s") { __typename, name } } '
% Node.to_global_id("MyOtherN... | {"onlyNode": None} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_query.py | test_query | assert | collection | 27 | import json
from functools import partial
from graphql import GraphQLError, ResolveInfo, Source, execute, parse
from ..context import Context
from ..dynamic import Dynamic
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from... | {"hello": "World"} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_datetime.py | test_date_query | assert | collection | 17 | import datetime
import pytz
from graphql import GraphQLError
from ..datetime import Date, DateTime, Time
from ..objecttype import ObjectType
from ..schema import Schema
def test_date_query():
now = datetime.datetime.now().replace(tzinfo=pytz.utc).date()
isoformat = now.isoformat()
result = schema.execut... | {"date": isoformat} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_datetime.py | test_time_query | assert | collection | 18 | import datetime
import pytz
from graphql import GraphQLError
from ..datetime import Date, DateTime, Time
from ..objecttype import ObjectType
from ..schema import Schema
def test_time_query():
now = datetime.datetime.now().replace(tzinfo=pytz.utc)
time = datetime.time(now.hour, now.minute, now.second, now.mic... | {"time": isoformat} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_abstracttype.py | test_generate_objecttype_inherit_abstracttype | assert | collection | 18 | from .. import abstracttype
from ..abstracttype import AbstractType
from ..field import Field
from ..objecttype import ObjectType
from ..unmountedtype import UnmountedType
def test_generate_objecttype_inherit_abstracttype():
class MyAbstractType(AbstractType):
field1 = MyScalar()
class MyObjectType(Ob... | ["field1", "field2"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_inputobjecttype.py | test_generate_inputobjecttype_inherit_abstracttype | assert | collection | 18 | from ..argument import Argument
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..objecttype import ObjectType
from ..scalars import Boolean, String
from ..schema import Schema
from ..unmountedtype import UnmountedType
def test_generate_inputobjecttype_i... | ["field1", "field2"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_interface.py | test_generate_interface_inherit_abstracttype | assert | collection | 13 | from ..field import Field
from ..interface import Interface
from ..unmountedtype import UnmountedType
def test_generate_interface_inherit_abstracttype():
class MyAbstractType(object):
field1 = MyScalar()
class MyInterface(Interface, MyAbstractType):
field2 = MyScalar()
assert list(MyInte... | ["field1", "field2"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_json.py | test_jsonstring_query | assert | collection | 12 | from ..json import JSONString
from ..objecttype import ObjectType
from ..schema import Schema
def test_jsonstring_query():
json_value = '{"key": "value"}'
json_value_quoted = json_value.replace('"', '\\"')
result = schema.execute("""{ json(input: "%s") }""" % json_value_quoted)
assert not result.error... | {"json": json_value} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_uuid.py | test_uuidstring_query | assert | collection | 10 | from ..objecttype import ObjectType
from ..schema import Schema
from ..uuid import UUID
def test_uuidstring_query():
uuid_value = "dfeb3bcf-70fd-11e7-a61a-6003088f8204"
result = schema.execute("""{ uuid(input: "%s") }""" % uuid_value)
assert not result.errors
assert result.data == | {"uuid": uuid_value} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_query.py | test_query_arguments | assert | collection | 30 | import json
from functools import partial
from graphql import GraphQLError, ResolveInfo, Source, execute, parse
from ..context import Context
from ..dynamic import Dynamic
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from... | {"test": "[null,{}]"} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_query.py | test_query_annotated_resolvers | assert | collection | 50 | import json
from functools import partial
from graphql import GraphQLError, ResolveInfo, Source, execute, parse
from ..context import Context
from ..dynamic import Dynamic
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from... | {"info": "base-info"} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_node.py | test_node_field_only_lazy_type_wrong | assert | collection | 16 | from collections import OrderedDict
from graphql_relay import to_global_id
from ...types import ObjectType, Schema, String
from ..node import Node, is_node
def test_node_field_only_lazy_type_wrong():
executed = schema.execute(
'{ onlyNodeLazy(id:"%s") { __typename, name } } '
% Node.to_global_id(... | {"onlyNodeLazy": None} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_node.py | test_node_query | assert | collection | 14 | from collections import OrderedDict
from graphql_relay import to_global_id
from ...types import ObjectType, Schema, String
from ..node import Node, is_node
def test_node_query():
executed = schema.execute(
'{ node(id:"%s") { ... on MyNode { name } } }' % Node.to_global_id("MyNode", 1)
)
assert no... | {"node": {"name": "1"}} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_datetime.py | test_datetime_query | assert | collection | 17 | import datetime
import pytz
from graphql import GraphQLError
from ..datetime import Date, DateTime, Time
from ..objecttype import ObjectType
from ..schema import Schema
def test_datetime_query():
now = datetime.datetime.now().replace(tzinfo=pytz.utc)
isoformat = now.isoformat()
result = schema.execute("... | {"datetime": isoformat} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_generic.py | test_generic_query_variable | assert | collection | 35 | from ..generic import GenericScalar
from ..objecttype import ObjectType
from ..schema import Schema
def test_generic_query_variable():
for generic_value in [
1,
1.1,
True,
"str",
[1, 2, 3],
[1.1, 2.2, 3.3],
[True, False],
["str1", "str2"],
{"k... | {"generic": generic_value} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_inputobjecttype.py | test_ordered_fields_in_inputobjecttype | assert | collection | 18 | from ..argument import Argument
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..objecttype import ObjectType
from ..scalars import Boolean, String
from ..schema import Schema
from ..unmountedtype import UnmountedType
def test_ordered_fields_in_inputobj... | ["b", "a", "field", "asa"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_interface.py | test_ordered_fields_in_interface | assert | collection | 13 | from ..field import Field
from ..interface import Interface
from ..unmountedtype import UnmountedType
def test_ordered_fields_in_interface():
class MyInterface(Interface):
b = Field(MyType)
a = Field(MyType)
field = MyScalar()
asa = Field(MyType)
assert list(MyInterface._meta.... | ["b", "a", "field", "asa"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_mutation.py | test_mutation_custom_output_type | assert | collection | 27 | import pytest
from ..argument import Argument
from ..dynamic import Dynamic
from ..mutation import Mutation
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
def test_mutation_custom_output_type():
class User(ObjectType):
name = S... | {"name": Argument(String)} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_query.py | test_query_annotated_resolvers | assert | collection | 42 | import json
from functools import partial
from graphql import GraphQLError, ResolveInfo, Source, execute, parse
from ..context import Context
from ..dynamic import Dynamic
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from... | {"annotated": "base-self"} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_connection.py | test_edge | assert | collection | 19 | import pytest
from ...types import Argument, Field, Int, List, NonNull, ObjectType, Schema, String
from ..connection import Connection, ConnectionField, PageInfo
from ..node import Node
def test_edge():
class MyObjectConnection(Connection):
class Meta:
node = MyObject
class Edge:
... | ["node", "cursor", "other"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_query.py | test_objecttype_on_instances | assert | collection | 40 | import json
from functools import partial
from graphql import GraphQLError, ResolveInfo, Source, execute, parse
from ..context import Context
from ..dynamic import Dynamic
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from... | {"ship": {"name": "xwing"}} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_query.py | test_big_list_query_benchmark | assert | collection | 33 | import json
from functools import partial
from graphql import GraphQLError, ResolveInfo, Source, execute, parse
from ..context import Context
from ..dynamic import Dynamic
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from... | {"allInts": list(big_list)} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_query.py | test_query_annotated_resolvers | assert | collection | 46 | import json
from functools import partial
from graphql import GraphQLError, ResolveInfo, Source, execute, parse
from ..context import Context
from ..dynamic import Dynamic
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from... | {"context": "base-context"} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_mutation.py | test_node_query | assert | collection | 23 | import pytest
from promise import Promise
from ...types import (
ID,
Argument,
Field,
InputField,
InputObjectType,
NonNull,
ObjectType,
Schema,
)
from ...types.scalars import String
from ..mutation import ClientIDMutation
def test_node_query():
executed = schema.execute(
'm... | {"say": {"phrase": "hello"}} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_mutation.py | test_mutation_input | assert | collection | 22 | import pytest
from promise import Promise
from ...types import (
ID,
Argument,
Field,
InputField,
InputObjectType,
NonNull,
ObjectType,
Schema,
)
from ...types.scalars import String
from ..mutation import ClientIDMutation
def test_mutation_input():
Input = SaySomething.Input
as... | ["what", "client_mutation_id"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_mutation.py | test_mutation_no_fields_output | assert | collection | 35 | import pytest
from ..argument import Argument
from ..dynamic import Dynamic
from ..mutation import Mutation
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
def test_mutation_no_fields_output():
class CreateUser(Mutation):
name =... | {"createUser": {"name": None}} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_union.py | test_generate_union | assert | collection | 18 | import pytest
from ..field import Field
from ..objecttype import ObjectType
from ..union import Union
from ..unmountedtype import UnmountedType
def test_generate_union():
class MyUnion(Union):
"""Documentation"""
class Meta:
types = (MyObjectType1, MyObjectType2)
assert MyUnion._... | (MyObjectType1, MyObjectType2) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_connection.py | test_connection | assert | collection | 20 | import pytest
from ...types import Argument, Field, Int, List, NonNull, ObjectType, Schema, String
from ..connection import Connection, ConnectionField, PageInfo
from ..node import Node
def test_connection():
class MyObjectConnection(Connection):
extra = String()
class Meta:
node = My... | ["page_info", "edges", "extra"] | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_connection.py | test_connectionfield_required | assert | collection | 22 | import pytest
from ...types import Argument, Field, Int, List, NonNull, ObjectType, Schema, String
from ..connection import Connection, ConnectionField, PageInfo
from ..node import Node
def test_connectionfield_required():
class MyObjectConnection(Connection):
class Meta:
node = MyObject
... | {"testConnection": {"edges": []}} | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_field.py | test_field_default_value_not_callable | assert | func_call | 18 | from functools import partial
import pytest
from ..argument import Argument
from ..field import Field
from ..scalars import String
from ..structures import NonNull
from .utils import MyLazyType
def test_field_default_value_not_callable():
MyType = object()
try:
Field(MyType, default_value=lambda: Tru... | str(e) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_objecttype.py | test_generate_objecttype | assert | func_call | 18 | import pytest
from ..field import Field
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
from ..unmountedtype import UnmountedType
def test_generate_objecttype():
class MyObjectType(ObjectType):
... | tuple() | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_argument.py | test_argument_comparasion | assert | func_call | 17 | from functools import partial
import pytest
from ..argument import Argument, to_arguments
from ..field import Field
from ..inputfield import InputField
from ..scalars import String
from ..structures import NonNull
def test_argument_comparasion():
arg1 = Argument(String, name="Hey", description="Desc", default_va... | String() | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/utils/tests/test_orderedtype.py | test_orderedtype_hash | assert | func_call | 8 | from ..orderedtype import OrderedType
def test_orderedtype_hash():
one = OrderedType()
two = OrderedType()
assert hash(one) == | hash(one) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/utils/tests/test_orderedtype.py | test_orderedtype_hash | assert | func_call | 9 | from ..orderedtype import OrderedType
def test_orderedtype_hash():
one = OrderedType()
two = OrderedType()
assert hash(one) == hash(one)
assert hash(one) != | hash(two) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | examples/starwars_relay/tests/test_objectidentification.py | test_str_schema | assert_* | func_call | 12 | from graphene.test import Client
from ..data import setup
from ..schema import schema
setup()
client = Client(schema)
def test_str_schema(snapshot):
snapshot.assert_match( | str(schema)) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_argument.py | test_argument_required | assert | func_call | 14 | from functools import partial
import pytest
from ..argument import Argument, to_arguments
from ..field import Field
from ..inputfield import InputField
from ..scalars import String
from ..structures import NonNull
def test_argument_required():
arg = Argument(String, required=True)
assert arg.type == | NonNull(String) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_mutation.py | test_no_mutate_and_get_payload | assert | func_call | 24 | import pytest
from promise import Promise
from ...types import (
ID,
Argument,
Field,
InputField,
InputObjectType,
NonNull,
ObjectType,
Schema,
)
from ...types.scalars import String
from ..mutation import ClientIDMutation
def test_no_mutate_and_get_payload():
with pytest.raises(Ass... | str(excinfo.value) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_mutation.py | test_mutation_raises_exception_if_no_mutate | assert | func_call | 18 | import pytest
from ..argument import Argument
from ..dynamic import Dynamic
from ..mutation import Mutation
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
def test_mutation_raises_exception_if_no_mutate():
with pytest.raises(AssertionE... | str(excinfo.value) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_mutation.py | test_mutation_allow_to_have_custom_args | assert | func_call | 32 | import pytest
from ..argument import Argument
from ..dynamic import Dynamic
from ..mutation import Mutation
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
def test_mutation_allow_to_have_custom_args():
class CreateUser(Mutation):
... | NonNull(CreateUser) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_schema.py | test_schema_introspect | assert | func_call | 11 | import pytest
from ..field import Field
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
def test_schema_introspect():
schema = Schema(Query)
assert "__schema" in | schema.introspect() | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | examples/starwars/tests/test_query.py | test_hero_name_query | assert_* | func_call | 19 | from graphene.test import Client
from ..data import setup
from ..schema import schema
setup()
client = Client(schema)
def test_hero_name_query(snapshot):
query = """
query HeroNameQuery {
hero {
name
}
}
"""
snapshot.assert_match( | client.execute(query)) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | examples/starwars_relay/tests/test_connections.py | test_correct_fetch_first_ship_rebels | assert_* | func_call | 33 | from graphene.test import Client
from ..data import setup
from ..schema import schema
setup()
client = Client(schema)
def test_correct_fetch_first_ship_rebels(snapshot):
query = """
query RebelsShipsQuery {
rebels {
name,
ships(first: 1) {
pageInfo {
startCursor
... | client.execute(query)) | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/pyutils/tests/test_enum.py | test__is_dunder | assert | bool_literal | 9 | from ..enum import _is_dunder, _is_sunder
def test__is_dunder():
dunder_names = ["__i__", "__test__"]
non_dunder_names = ["test", "__test", "_test", "_test_", "test__", ""]
for name in dunder_names:
assert _is_dunder(name) is | True | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_field.py | test_field_source_argument_as_kw | assert | bool_literal | 18 | from functools import partial
import pytest
from ..argument import Argument
from ..field import Field
from ..scalars import String
from ..structures import NonNull
from .utils import MyLazyType
def test_field_source_argument_as_kw():
MyType = object()
field = Field(MyType, b=NonNull(True), c=Argument(None), ... | True | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_scalars_serialization.py | test_serializes_output_boolean | assert | bool_literal | 5 | from ..scalars import Boolean, Float, Int, String
def test_serializes_output_boolean():
assert Boolean.serialize("string") is | True | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_typemap.py | test_objecttype_with_possible_types | assert | bool_literal | 38 | import pytest
from graphql.type import (
GraphQLArgument,
GraphQLEnumType,
GraphQLEnumValue,
GraphQLField,
GraphQLInputObjectField,
GraphQLInputObjectType,
GraphQLInterfaceType,
GraphQLObjectType,
GraphQLString,
)
from ..dynamic import Dynamic
from ..enum import Enum
from ..field im... | True | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/pyutils/tests/test_enum.py | test__is_dunder | assert | bool_literal | 12 | from ..enum import _is_dunder, _is_sunder
def test__is_dunder():
dunder_names = ["__i__", "__test__"]
non_dunder_names = ["test", "__test", "_test", "_test_", "test__", ""]
for name in dunder_names:
assert _is_dunder(name) is True
for name in non_dunder_names:
assert _is_dunder(name)... | False | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_global_id.py | test_global_id_defaults_to_required_and_node | assert | variable | 11 | from graphql_relay import to_global_id
from ...types import ID, NonNull, ObjectType, String
from ...types.definitions import GrapheneObjectType
from ..node import GlobalID, Node
def test_global_id_defaults_to_required_and_node():
gid = GlobalID()
assert isinstance(gid.type, NonNull)
assert gid.type.of_ty... | ID | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_enum.py | test_enum_value_as_unmounted_field | assert | variable | 19 | import six
from ..argument import Argument
from ..enum import Enum, PyEnum
from ..field import Field
from ..inputfield import InputField
from ..schema import ObjectType, Schema
def test_enum_value_as_unmounted_field():
class RGB(Enum):
RED = 1
GREEN = 2
BLUE = 3
unmounted = RGB()
... | RGB | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/utils/tests/test_orderedtype.py | test_orderedtype | assert | variable | 9 | from ..orderedtype import OrderedType
def test_orderedtype():
one = OrderedType()
two = OrderedType()
three = OrderedType()
assert one < | two | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/utils/tests/test_orderedtype.py | test_orderedtype_eq | assert | variable | 8 | from ..orderedtype import OrderedType
def test_orderedtype_eq():
one = OrderedType()
two = OrderedType()
assert one == | one | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_global_id.py | test_global_id_defaults_to_required_and_node | assert | variable | 12 | from graphql_relay import to_global_id
from ...types import ID, NonNull, ObjectType, String
from ...types.definitions import GrapheneObjectType
from ..node import GlobalID, Node
def test_global_id_defaults_to_required_and_node():
gid = GlobalID()
assert isinstance(gid.type, NonNull)
assert gid.type.of_typ... | Node | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_node.py | test_node_field | assert | variable | 11 | from collections import OrderedDict
from graphql_relay import to_global_id
from ...types import ObjectType, Schema, String
from ..node import Node, is_node
def test_node_field():
node_field = Node.Field()
assert node_field.type == | Node | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_argument.py | test_argument_comparasion | assert | variable | 16 | from functools import partial
import pytest
from ..argument import Argument, to_arguments
from ..field import Field
from ..inputfield import InputField
from ..scalars import String
from ..structures import NonNull
def test_argument_comparasion():
arg1 = Argument(String, name="Hey", description="Desc", default_va... | arg2 | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_field.py | test_field_basic | assert | variable | 32 | from functools import partial
import pytest
from ..argument import Argument
from ..field import Field
from ..scalars import String
from ..structures import NonNull
from .utils import MyLazyType
def test_field_basic():
MyType = object()
args = {"my arg": Argument(True)}
def resolver():
return Non... | args | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_mutation.py | test_mutation_custom_output_type | assert | variable | 26 | import pytest
from ..argument import Argument
from ..dynamic import Dynamic
from ..mutation import Mutation
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
def test_mutation_custom_output_type():
class User(ObjectType):
name = S... | User | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_definition.py | test_defines_a_query_only_schema | assert | variable | 17 | from ..argument import Argument
from ..enum import Enum
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import Boolean, Int, String
from ..schema import Schema
from ..structur... | Query | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_enum.py | test_enum_from_builtin_enum | assert | variable | 14 | import six
from ..argument import Argument
from ..enum import Enum, PyEnum
from ..field import Field
from ..inputfield import InputField
from ..schema import ObjectType, Schema
def test_enum_from_builtin_enum():
PyRGB = PyEnum("RGB", "RED,GREEN,BLUE")
RGB = Enum.from_enum(PyRGB)
assert RGB._meta.enum ==... | PyRGB | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_enum.py | test_enum_from_python3_enum_uses_enum_doc | assert | variable | 24 | import six
from ..argument import Argument
from ..enum import Enum, PyEnum
from ..field import Field
from ..inputfield import InputField
from ..schema import ObjectType, Schema
def test_enum_from_python3_enum_uses_enum_doc():
if not six.PY3:
return
from enum import Enum as PyEnum
class Color(PyE... | Color | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_schema.py | test_schema_get_type | assert | variable | 11 | import pytest
from ..field import Field
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
def test_schema_get_type():
schema = Schema(Query)
assert schema.Query == | Query | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_structures.py | test_list_comparasion | assert | variable | 18 | from functools import partial
import pytest
from ..scalars import String
from ..structures import List, NonNull
from .utils import MyLazyType
def test_list_comparasion():
list1 = List(String)
list2 = List(String)
list3 = List(None)
list1_argskwargs = List(String, None, b=True)
list2_argskwargs =... | list2 | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_structures.py | test_list_comparasion | assert | variable | 19 | from functools import partial
import pytest
from ..scalars import String
from ..structures import List, NonNull
from .utils import MyLazyType
def test_list_comparasion():
list1 = List(String)
list2 = List(String)
list3 = List(None)
list1_argskwargs = List(String, None, b=True)
list2_argskwargs =... | list3 | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_connection.py | test_edge | assert | variable | 25 | import pytest
from ...types import Argument, Field, Int, List, NonNull, ObjectType, Schema, String
from ..connection import Connection, ConnectionField, PageInfo
from ..node import Node
def test_edge():
class MyObjectConnection(Connection):
class Meta:
node = MyObject
class Edge:
... | String | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_mutation.py | test_mutation | assert | variable | 31 | import pytest
from promise import Promise
from ...types import (
ID,
Argument,
Field,
InputField,
InputObjectType,
NonNull,
ObjectType,
Schema,
)
from ...types.scalars import String
from ..mutation import ClientIDMutation
def test_mutation():
fields = SaySomething._meta.fields
... | String | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_node.py | test_node_field_custom | assert | variable | 11 | from collections import OrderedDict
from graphql_relay import to_global_id
from ...types import ObjectType, Schema, String
from ..node import Node, is_node
def test_node_field_custom():
node_field = Node.Field(MyNode)
assert node_field.type == | MyNode | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/relay/tests/test_node_custom.py | get_node_from_global_id | assert | variable | 15 | from graphql import graphql
from ...types import Interface, ObjectType, Schema
from ...types.scalars import Int, String
from ..node import Node
class CustomNode(Node):
def to_global_id(type, id):
return id
@staticmethod
def get_node_from_global_id(info, id, only_type=None):
assert info.... | schema | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_argument.py | test_argument | assert | variable | 14 | from functools import partial
import pytest
from ..argument import Argument, to_arguments
from ..field import Field
from ..inputfield import InputField
from ..scalars import String
from ..structures import NonNull
def test_argument():
arg = Argument(String, default_value="a", description="desc", name="b")
a... | String | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_argument.py | test_argument_with_lazy_type | assert | variable | 15 | from functools import partial
import pytest
from ..argument import Argument, to_arguments
from ..field import Field
from ..inputfield import InputField
from ..scalars import String
from ..structures import NonNull
def test_argument_with_lazy_type():
MyType = object()
arg = Argument(lambda: MyType)
asser... | MyType | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_definition.py | test_defines_a_query_only_schema | assert | variable | 27 | from ..argument import Argument
from ..enum import Enum
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import Boolean, Int, String
from ..schema import Schema
from ..structur... | String | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_dynamic.py | test_dynamic | assert | variable | 10 | from functools import partial
from ..dynamic import Dynamic
from ..scalars import String
from ..structures import List, NonNull
def test_dynamic():
dynamic = Dynamic(lambda: String)
assert dynamic.get_type() == | String | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_field.py | test_field_required | assert | variable | 16 | from functools import partial
import pytest
from ..argument import Argument
from ..field import Field
from ..scalars import String
from ..structures import NonNull
from .utils import MyLazyType
def test_field_required():
MyType = object()
field = Field(MyType, required=True)
assert isinstance(field.type,... | MyType | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_field.py | test_field_source_as_argument | assert | variable | 16 | from functools import partial
import pytest
from ..argument import Argument
from ..field import Field
from ..scalars import String
from ..structures import NonNull
from .utils import MyLazyType
def test_field_source_as_argument():
MyType = object()
field = Field(MyType, source=String())
assert "source" i... | String | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_inputfield.py | test_inputfield_required | assert | variable | 12 | from functools import partial
from ..inputfield import InputField
from ..structures import NonNull
from .utils import MyLazyType
def test_inputfield_required():
MyType = object()
field = InputField(MyType, required=True)
assert isinstance(field.type, NonNull)
assert field.type.of_type == | MyType | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_inputobjecttype.py | test_generate_inputobjecttype_as_argument | assert | variable | 21 | from ..argument import Argument
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..objecttype import ObjectType
from ..scalars import Boolean, String
from ..schema import Schema
from ..unmountedtype import UnmountedType
def test_generate_inputobjecttype_a... | MyType | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
graphql-python/graphene | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | train | train | graphene/types/tests/test_mountedtype.py | test_mounted_type | assert | variable | 9 | from ..field import Field
from ..scalars import String
def test_mounted_type():
unmounted = String()
mounted = Field.mounted(unmounted)
assert isinstance(mounted, Field)
assert mounted.type == | String | bfd6fd7c49f4181ff4d83b695675db76aa6ee4d0 | 284 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.