Skip to content

Commit 20038db

Browse files
committed
Checking returned types after __setitems__ on AOT
1 parent ebc42e2 commit 20038db

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_items.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from tests.util import assert_is_ppo
1414
from tests.util import elementary_test
15-
from tomlkit import api
15+
from tomlkit import api, value
1616
from tomlkit import parse
1717
from tomlkit.exceptions import NonExistentKey
1818
from tomlkit.items import Array
@@ -129,13 +129,16 @@ def test_aot_unwrap():
129129
assert_is_ppo(vu, str)
130130

131131
def test_aot_set_item():
132-
d = item(["A", {"b": "B"}])
132+
d = item(["A", {"b": "B"}, ["c", "D"]])
133133
d[0] = "C"
134+
assert isinstance(d[0], String)
134135
assert d[0] == "C"
135136
d[1]["b"] = "D"
137+
assert isinstance(d[1], InlineTable)
136138
assert d[1]["b"] == "D"
137-
d[0] = {"c": "C"}
138-
assert d[0]["c"] == "C"
139+
d[0] = ["c", "C"]
140+
assert isinstance(d[0], Array)
141+
assert d[0][1] == "C"
139142

140143
def test_time_unwrap():
141144
t = time(3, 8, 14)

0 commit comments

Comments
 (0)