Skip to content

Commit d512398

Browse files
committed
Fixed flake8 errors
1 parent 078c3a7 commit d512398

File tree

8 files changed

+741
-726
lines changed

8 files changed

+741
-726
lines changed

graphql/language/printer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ def leave_TypeExtensionDefinition(self, node, *args):
152152
return 'extend ' + node.definition
153153

154154
def leave_DirectiveDefinition(self, node, *args):
155-
return 'directive @{}{} on {}'.format(node.name, wrap('(', join(node.arguments, ', '), ')'), ' | '.join(node.locations))
155+
return 'directive @{}{} on {}'.format(node.name, wrap(
156+
'(', join(node.arguments, ', '), ')'), ' | '.join(node.locations))
156157

157158

158159
def join(maybe_list, separator=''):
Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from ..contain_subset import contain_subset
22

33
plain_object = {
4-
'a':'b',
5-
'c':'d'
4+
'a': 'b',
5+
'c': 'd'
66
}
77

88
complex_object = {
@@ -16,38 +16,39 @@
1616
}
1717
}
1818

19+
1920
def test_plain_object_should_pass_for_smaller_object():
2021
assert contain_subset({'a': 'b'}, plain_object)
2122

2223

2324
def test_plain_object_should_pass_for_same_object():
2425
assert contain_subset({
25-
'a':'b',
26-
'c':'d'
26+
'a': 'b',
27+
'c': 'd'
2728
}, plain_object)
2829

2930

3031
def test_plain_object_should_reject_for_similar_object():
3132
assert not contain_subset({
32-
'a':'notB',
33-
'c':'d'
33+
'a': 'notB',
34+
'c': 'd'
3435
}, plain_object)
3536

3637

3738
def test_complex_object_should_pass_for_smaller_object():
3839
assert contain_subset({
39-
'a':'b',
40+
'a': 'b',
4041
'e': {
41-
'foo':'bar'
42+
'foo': 'bar'
4243
}
4344
}, complex_object)
4445

4546

4647
def test_complex_object_should_pass_for_smaller_object_other():
4748
assert contain_subset({
4849
'e': {
49-
'foo':'bar',
50-
'baz':{
50+
'foo': 'bar',
51+
'baz': {
5152
'qux': 'quux'
5253
}
5354
}
@@ -70,8 +71,8 @@ def test_complex_object_should_pass_for_same_object():
7071
def test_complex_object_should_reject_for_similar_object():
7172
assert not contain_subset({
7273
'e': {
73-
'foo':'bar',
74-
'baz':{
74+
'foo': 'bar',
75+
'baz': {
7576
'qux': 'notAQuux'
7677
}
7778
}
@@ -80,47 +81,47 @@ def test_complex_object_should_reject_for_similar_object():
8081

8182
def test_circular_objects_should_contain_subdocument():
8283
obj = {}
83-
obj['arr'] = [obj,obj]
84+
obj['arr'] = [obj, obj]
8485
obj['arr'].append(obj['arr'])
8586
obj['obj'] = obj
8687

8788
assert contain_subset({
88-
'arr': [
89-
{'arr': []},
89+
'arr': [
90+
{'arr': []},
91+
{'arr': []},
92+
[
9093
{'arr': []},
91-
[
92-
{'arr': []},
93-
{'arr': []}
94-
]
94+
{'arr': []}
9595
]
96-
}, obj)
96+
]
97+
}, obj)
9798

9899

99100
def test_circular_objects_should_not_contain_similardocument():
100101
obj = {}
101-
obj['arr'] = [obj,obj]
102+
obj['arr'] = [obj, obj]
102103
obj['arr'].append(obj['arr'])
103104
obj['obj'] = obj
104105

105106
assert not contain_subset({
106-
'arr': [
107-
{'arr': ['just random field']},
107+
'arr': [
108+
{'arr': ['just random field']},
109+
{'arr': []},
110+
[
108111
{'arr': []},
109-
[
110-
{'arr': []},
111-
{'arr': []}
112-
]
112+
{'arr': []}
113113
]
114-
}, obj)
114+
]
115+
}, obj)
115116

116117

117118
def test_should_contain_others():
118119
obj = {
119-
'elems': [{'a':'b', 'c':'d', 'e':'f'}, {'g':'h'}]
120+
'elems': [{'a': 'b', 'c': 'd', 'e': 'f'}, {'g': 'h'}]
120121
}
121122
assert contain_subset({
122123
'elems': [{
123-
'g':'h'
124-
},{'a':'b','e':'f'}
124+
'g': 'h'
125+
}, {'a': 'b', 'e': 'f'}
125126
]
126127
}, obj)

graphql/type/tests/test_definition.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,12 @@ def test_includes_interfaces_subtypes_in_the_type_map():
196196
interfaces=[SomeInterface],
197197
is_type_of=lambda: None
198198
)
199-
schema = GraphQLSchema(query=GraphQLObjectType(name='Query', fields={'iface': GraphQLField(SomeInterface)}), types=[SomeSubtype])
199+
schema = GraphQLSchema(
200+
query=GraphQLObjectType(
201+
name='Query',
202+
fields={
203+
'iface': GraphQLField(SomeInterface)}),
204+
types=[SomeSubtype])
200205
assert schema.get_type_map()['SomeSubtype'] == SomeSubtype
201206

202207

0 commit comments

Comments
 (0)