mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-22 13:59:51 +03:00
linting
This commit is contained in:
parent
a3cfdb5d4d
commit
79c8c04cb0
|
@ -47,10 +47,16 @@ class TestUUIDGlobalID:
|
||||||
fields = [f for t, f in parsed]
|
fields = [f for t, f in parsed]
|
||||||
custom_node_interface = "interface CustomNode"
|
custom_node_interface = "interface CustomNode"
|
||||||
assert custom_node_interface in types
|
assert custom_node_interface in types
|
||||||
assert '"""The ID of the object"""\n id: UUID!' == fields[types.index(custom_node_interface)]
|
assert (
|
||||||
|
'"""The ID of the object"""\n id: UUID!'
|
||||||
|
== fields[types.index(custom_node_interface)]
|
||||||
|
)
|
||||||
user_type = "type User implements CustomNode"
|
user_type = "type User implements CustomNode"
|
||||||
assert user_type in types
|
assert user_type in types
|
||||||
assert '"""The ID of the object"""\n id: UUID!\n name: String' == fields[types.index(user_type)]
|
assert (
|
||||||
|
'"""The ID of the object"""\n id: UUID!\n name: String'
|
||||||
|
== fields[types.index(user_type)]
|
||||||
|
)
|
||||||
|
|
||||||
def test_get_by_id(self):
|
def test_get_by_id(self):
|
||||||
query = """query userById($id: UUID!) {
|
query = """query userById($id: UUID!) {
|
||||||
|
@ -61,7 +67,9 @@ class TestUUIDGlobalID:
|
||||||
}"""
|
}"""
|
||||||
# UUID need to be converted to string for serialization
|
# UUID need to be converted to string for serialization
|
||||||
result = graphql_sync(
|
result = graphql_sync(
|
||||||
self.graphql_schema, query, variable_values={"id": str(self.user_list[0]["id"])}
|
self.graphql_schema,
|
||||||
|
query,
|
||||||
|
variable_values={"id": str(self.user_list[0]["id"])},
|
||||||
)
|
)
|
||||||
assert not result.errors
|
assert not result.errors
|
||||||
assert result.data["user"]["id"] == str(self.user_list[0]["id"])
|
assert result.data["user"]["id"] == str(self.user_list[0]["id"])
|
||||||
|
@ -107,10 +115,16 @@ class TestSimpleGlobalID:
|
||||||
fields = [f for t, f in parsed]
|
fields = [f for t, f in parsed]
|
||||||
custom_node_interface = "interface CustomNode"
|
custom_node_interface = "interface CustomNode"
|
||||||
assert custom_node_interface in types
|
assert custom_node_interface in types
|
||||||
assert '"""The ID of the object"""\n id: ID!' == fields[types.index(custom_node_interface)]
|
assert (
|
||||||
|
'"""The ID of the object"""\n id: ID!'
|
||||||
|
== fields[types.index(custom_node_interface)]
|
||||||
|
)
|
||||||
user_type = "type User implements CustomNode"
|
user_type = "type User implements CustomNode"
|
||||||
assert user_type in types
|
assert user_type in types
|
||||||
assert '"""The ID of the object"""\n id: ID!\n name: String' == fields[types.index(user_type)]
|
assert (
|
||||||
|
'"""The ID of the object"""\n id: ID!\n name: String'
|
||||||
|
== fields[types.index(user_type)]
|
||||||
|
)
|
||||||
|
|
||||||
def test_get_by_id(self):
|
def test_get_by_id(self):
|
||||||
query = """query {
|
query = """query {
|
||||||
|
@ -180,10 +194,16 @@ class TestCustomGlobalID:
|
||||||
fields = [f for t, f in parsed]
|
fields = [f for t, f in parsed]
|
||||||
custom_node_interface = "interface CustomNode"
|
custom_node_interface = "interface CustomNode"
|
||||||
assert custom_node_interface in types
|
assert custom_node_interface in types
|
||||||
assert '"""The ID of the object"""\n id: Int!' == fields[types.index(custom_node_interface)]
|
assert (
|
||||||
|
'"""The ID of the object"""\n id: Int!'
|
||||||
|
== fields[types.index(custom_node_interface)]
|
||||||
|
)
|
||||||
user_type = "type User implements CustomNode"
|
user_type = "type User implements CustomNode"
|
||||||
assert user_type in types
|
assert user_type in types
|
||||||
assert '"""The ID of the object"""\n id: Int!\n name: String' == fields[types.index(user_type)]
|
assert (
|
||||||
|
'"""The ID of the object"""\n id: Int!\n name: String'
|
||||||
|
== fields[types.index(user_type)]
|
||||||
|
)
|
||||||
|
|
||||||
def test_get_by_id(self):
|
def test_get_by_id(self):
|
||||||
query = """query {
|
query = """query {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user