fix dependency ordering bug in basic properties containing template strings

This commit is contained in:
evilchili
2023-12-31 09:55:09 -08:00
parent 07884a0fbe
commit 2dda47f9c4
2 changed files with 28 additions and 14 deletions
+22 -8
View File
@@ -1,11 +1,25 @@
from dnd_item import types
def test_item_attributes():
item = types.Item.from_dict(
foo='bar',
baz={
'qaz': True
}
)
assert item.baz.qaz is True
def test_Item_attributes():
assert types.Item.from_dict(dict(
name='{length}ft. Pole',
weight='7lbs.',
value=5,
length=10
)).name == '10ft. Pole'
def test_item_nested_attributes():
assert types.Item.from_dict(dict(
name='{length}ft. Pole',
length=10,
properties=dict(
engraved=dict(
description='"Property of {info.owner}!"'
),
),
info=dict(
owner='Jules Ultardottir',
)
)).description == 'Engraved. "Property of Jules Ultardottir!"'