fix dependency ordering bug in basic properties containing template strings
This commit is contained in:
+22
-8
@@ -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!"'
|
||||
|
||||
Reference in New Issue
Block a user