Skip to content

Commit 5b11111

Browse files
DOC-3787 added flake8 formatting
1 parent a8791bf commit 5b11111

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

doctests/dt_json.py

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@
215215

216216
# STEP_START get_bikes
217217
res2 = r.json().get("bikes:inventory", "$.inventory.*")
218-
print(
219-
res2
220-
)
218+
print(res2)
221219
# >>> [[{'id': 'bike:1', 'model': 'Phoebe',
222220
# >>> 'description': 'This is a mid-travel trail slayer...
223221
# STEP_END
@@ -262,22 +260,26 @@
262260
"bikes:inventory",
263261
"$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]",
264262
)
265-
print(
266-
res8
267-
) # >>> [{'id': 'bike:2', 'model': 'Quaoar',
263+
print(res8)
264+
# >>> [{'id': 'bike:2', 'model': 'Quaoar',
268265
# 'description': "Redesigned for the 2020 model year...
269266
# STEP_END
270267

271268
# REMOVE_START
272-
assert res8 == [{
273-
'id': 'bike:2', 'model': 'Quaoar',
274-
'description': "Redesigned for the 2020 model year, this bike impressed "
275-
"our testers and is the best all-around trail bike we've ever tested. "
276-
"The Shimano gear system effectively does away with an external cassette, "
277-
"so is super low maintenance in terms of wear and tear. All in all it's "
278-
"an impressive package for the price, making it very competitive.",
279-
'price': 2072, 'specs': {'material': 'aluminium', 'weight': 7.9},
280-
'colors': ['black', 'white']}]
269+
assert res8 == [
270+
{
271+
'id': 'bike:2',
272+
'model': 'Quaoar',
273+
'description': "Redesigned for the 2020 model year, this bike impressed "
274+
"our testers and is the best all-around trail bike we've ever tested. "
275+
"The Shimano gear system effectively does away with an external cassette, "
276+
"so is super low maintenance in terms of wear and tear. All in all it's "
277+
"an impressive package for the price, making it very competitive.",
278+
'price': 2072,
279+
'specs': {'material': 'aluminium', 'weight': 7.9},
280+
'colors': ['black', 'white']
281+
}
282+
]
281283
# REMOVE_END
282284

283285
# STEP_START filter2
@@ -289,7 +291,7 @@
289291
# STEP_END
290292

291293
# REMOVE_START
292-
assert res9 == ['Weywot', 'Mimas']
294+
assert res9 == ["Weywot", "Mimas"]
293295
# REMOVE_END
294296

295297
# STEP_START filter3
@@ -305,19 +307,13 @@
305307

306308
# STEP_START filter4
307309
res11 = r.json().set(
308-
"bikes:inventory",
309-
"$.inventory.mountain_bikes[0].regex_pat",
310-
"(?i)al"
310+
"bikes:inventory", "$.inventory.mountain_bikes[0].regex_pat", "(?i)al"
311311
)
312312
res12 = r.json().set(
313-
"bikes:inventory",
314-
"$.inventory.mountain_bikes[1].regex_pat",
315-
"(?i)al"
313+
"bikes:inventory", "$.inventory.mountain_bikes[1].regex_pat", "(?i)al"
316314
)
317315
res13 = r.json().set(
318-
"bikes:inventory",
319-
"$.inventory.mountain_bikes[2].regex_pat",
320-
"(?i)al"
316+
"bikes:inventory", "$.inventory.mountain_bikes[2].regex_pat", "(?i)al"
321317
)
322318

323319
res14 = r.json().get(
@@ -328,7 +324,7 @@
328324
# STEP_END
329325

330326
# REMOVE_START
331-
assert res14 == ['Quaoar', 'Weywot']
327+
assert res14 == ["Quaoar", "Weywot"]
332328
# REMOVE_END
333329

334330
# STEP_START update_bikes
@@ -349,7 +345,9 @@
349345
# REMOVE_END
350346

351347
# STEP_START update_filters1
352-
res18 = r.json().set("bikes:inventory", "$.inventory.*[?(@.price<2000)].price", 1500)
348+
res18 = r.json().set(
349+
"bikes:inventory", "$.inventory.*[?(@.price<2000)].price", 1500
350+
)
353351
res19 = r.json().get("bikes:inventory", "$..price")
354352
print(res19) # >>> [1500, 2072, 3264, 1500, 3941]
355353
# STEP_END

0 commit comments

Comments
 (0)