Skip to content

Commit

Permalink
TST: add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Jan 17, 2025
1 parent 55bdbb6 commit 1a2486e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,18 @@ def test_nested_mutation(d):
d["x"]["y"] = {}
d["x"]["y"]["z"] = {}
d["x"]["y"]["z"]["i"] = []
d["x"]["y"]["z"]["i"].append(1)
lsti = d["x"]["y"]["z"]["i"]
lsti.append([])
lsti[0].append(1)
d["x"]["y"]["z"]["j"] = 2
d["x"]["y"]["z"]["k"] = []
d["x"]["y"]["z"]["k"].append({})
d["x"]["y"]["z"]["k"][0]["p"] = []
d["x"]["y"]["z"]["k"][0]["p"].append(3)

assert d == {"x": {"y": {"z": {"i": [1], "j": 2, "k": [{"p": [3]}]}}}}
assert d["x"]["y"]["z"]["i"] == lsti

assert d == {"x": {"y": {"z": {"i": [[1]], "j": 2, "k": [{"p": [3]}]}}}}


def test_copy_returns_plain_object(d):
Expand Down

0 comments on commit 1a2486e

Please sign in to comment.