1"""Assorted runtime unit tests 2""" 3import unittest 4 5from mako import runtime 6from test import eq_ 7 8 9class ContextTest(unittest.TestCase): 10 def test_locals_kwargs(self): 11 c = runtime.Context(None, foo="bar") 12 eq_(c.kwargs, {"foo": "bar"}) 13 14 d = c._locals({"zig": "zag"}) 15 16 # kwargs is the original args sent to the Context, 17 # it's intentionally kept separate from _data 18 eq_(c.kwargs, {"foo": "bar"}) 19 eq_(d.kwargs, {"foo": "bar"}) 20 21 eq_(d._data["zig"], "zag") 22