Skip to content

Commit 7ae9541

Browse files
committed
linting
1 parent 90bf0cf commit 7ae9541

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

flask_rebar/swagger_generation/swagger_generator_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def get_todos_by_type(type_):
214214
flask_converter="todo_type",
215215
swagger_type=TodoTypeConverter,
216216
)
217-
217+
218218
With the above example, when something is labeled as a ``todo_type`` in
219219
a path. The correct swagger can be returned.
220220
"""

tests/examples/test_todo.py

+18-2
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,30 @@ def test_crud(self):
7777
headers={"X-MyApp-Key": "my-api-key", "Content-Type": "application/json"},
7878
)
7979
self.assertEqual(resp.status_code, 200)
80-
self.assertEqual(resp.json["data"][0], {"id": 1, "complete": True, "description": "Find product market fit", "type": "user"})
80+
self.assertEqual(
81+
resp.json["data"][0],
82+
{
83+
"id": 1,
84+
"complete": True,
85+
"description": "Find product market fit",
86+
"type": "user",
87+
},
88+
)
8189

8290
resp = self.app.test_client().get(
8391
"/todos/user",
8492
headers={"X-MyApp-Key": "my-api-key", "Content-Type": "application/json"},
8593
)
8694
self.assertEqual(resp.status_code, 200)
87-
self.assertEqual(resp.json["data"][0], {"id": 1, "complete": True, "description": "Find product market fit", "type": "user"})
95+
self.assertEqual(
96+
resp.json["data"][0],
97+
{
98+
"id": 1,
99+
"complete": True,
100+
"description": "Find product market fit",
101+
"type": "user",
102+
},
103+
)
88104

89105
resp = self.app.test_client().get(
90106
"/todos/group",

tests/swagger_generation/registries/legacy.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212

1313

1414
class UUIDPathConverter:
15-
1615
@staticmethod
1716
def to_swagger():
18-
return {
19-
sw.type_: sw.string,
20-
sw.format_: sw.uuid
21-
}
17+
return {sw.type_: sw.string, sw.format_: sw.uuid}
2218

2319

2420
swagger_v2_generator = SwaggerV2Generator()
@@ -124,7 +120,13 @@ def tagged_foos():
124120
"paths": {
125121
"/foos/{foo_uid}": {
126122
"parameters": [
127-
{"name": "foo_uid", "in": "path", "required": True, "type": "string", "format": "uuid"}
123+
{
124+
"name": "foo_uid",
125+
"in": "path",
126+
"required": True,
127+
"type": "string",
128+
"format": "uuid",
129+
}
128130
],
129131
"get": {
130132
"operationId": "get_foo",

0 commit comments

Comments
 (0)