Skip to content

Commit eb987ac

Browse files
committed
Fix style.
1 parent 1610e28 commit eb987ac

File tree

1 file changed

+49
-14
lines changed

1 file changed

+49
-14
lines changed

jsonschema/tests/test_validators.py

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,10 @@ def test_recursive(self):
439439
"children": {
440440
"type": "object",
441441
"patternProperties": {
442-
"^.*$": {
443-
"$ref": "#/definitions/node",
444-
},
445-
},
442+
"^.*$": {
443+
"$ref": "#/definitions/node",
444+
},
445+
},
446446
},
447447
},
448448
}],
@@ -475,20 +475,55 @@ def test_recursive(self):
475475

476476
e, = validator.iter_errors(instance)
477477
self.assertEqual(e.absolute_path, deque(["root"]))
478-
self.assertEqual(e.absolute_schema_path, deque(['properties', 'root', 'anyOf']))
478+
self.assertEqual(
479+
e.absolute_schema_path, deque(["properties", "root", "anyOf"]),
480+
)
479481

480482
e1, = e.context
481-
self.assertEqual(e1.absolute_path, deque(['root', 'children', 'a']))
482-
self.assertEqual(e1.absolute_schema_path,
483-
deque(['properties', 'root', 'anyOf', 0, 'properties',
484-
'children', 'patternProperties', '^.*$', 'anyOf']))
483+
self.assertEqual(e1.absolute_path, deque(["root", "children", "a"]))
484+
self.assertEqual(
485+
e1.absolute_schema_path, deque(
486+
[
487+
"properties",
488+
"root",
489+
"anyOf",
490+
0,
491+
"properties",
492+
"children",
493+
"patternProperties",
494+
"^.*$",
495+
"anyOf",
496+
],
497+
),
498+
)
485499

486500
e2, = e1.context
487-
self.assertEqual(e2.absolute_path, deque(['root', 'children', 'a', 'children', 'ab']))
488-
self.assertEqual(e2.absolute_schema_path,
489-
deque(['properties', 'root', 'anyOf', 0, 'properties',
490-
'children', 'patternProperties', '^.*$', 'anyOf', 0, 'properties',
491-
'children', 'patternProperties', '^.*$', 'anyOf']))
501+
self.assertEqual(
502+
e2.absolute_path, deque(
503+
["root", "children", "a", "children", "ab"],
504+
),
505+
)
506+
self.assertEqual(
507+
e2.absolute_schema_path, deque(
508+
[
509+
"properties",
510+
"root",
511+
"anyOf",
512+
0,
513+
"properties",
514+
"children",
515+
"patternProperties",
516+
"^.*$",
517+
"anyOf",
518+
0,
519+
"properties",
520+
"children",
521+
"patternProperties",
522+
"^.*$",
523+
"anyOf"
524+
],
525+
),
526+
)
492527

493528
def test_additionalProperties(self):
494529
instance = {"bar": "bar", "foo": 2}

0 commit comments

Comments
 (0)