Skip to content

Commit

Permalink
add test case to cover the change
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed Feb 8, 2022
1 parent c41d4f9 commit bd1e498
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,3 +382,13 @@ def test_value_rejects_values_with_appendage(raw):
"""Values that appear valid at the beginning but leave chars unparsed are rejected."""
with pytest.raises(tomlkit.exceptions.ParseError):
tomlkit.value(raw)


def test_create_super_table_with_table():
data = {"foo": {"bar": {"a": 1}}}
assert dumps(data) == "[foo.bar]\na = 1\n"


def test_create_super_table_with_aot():
data = {"foo": {"bar": [{"a": 1}]}}
assert dumps(data) == "[[foo.bar]]\na = 1\n"

0 comments on commit bd1e498

Please sign in to comment.