Skip to content

Commit

Permalink
add a test case
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed May 20, 2021
1 parent 60da0c0 commit 4cdc2f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions tests/test_toml_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,3 +669,16 @@ def test_repr():
)

assert repr(doc["namespace"]) == "{'key1': 'value1', 'key2': 'value2'}"


def test_deepcopy():
content = """
[tool]
name = "foo"
[tool.project.section]
option = "test"
"""
doc = parse(content)
copied = copy.deepcopy(doc)
assert copied == doc
assert copied.as_string() == content
2 changes: 1 addition & 1 deletion tomlkit/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def __setstate__(self, state):
self._body = state[1]
self._parsed = state[2]
self._table_keys = state[3]

for key, item in self._body:
if key is not None:
dict.__setitem__(self, key.key, item.value)
Expand Down

0 comments on commit 4cdc2f6

Please sign in to comment.