import rinja
# retoor <retoor@molodetz.nl>
def test_access_attribute():
class Obj:
x = 10
env = rinja.Environment()
assert env.from_string("{{ obj.x }}").render(obj=Obj()) == "10"
def test_access_subscript_list():
env = rinja.Environment()
assert env.from_string("{{ items[0] }}").render(items=[1, 2]) == "1"
def test_access_subscript_dict():
env = rinja.Environment()
assert env.from_string("{{ data['key'] }}").render(data={"key": "val"}) == "val"