File: test_runtime.py

package info (click to toggle)
mako 1.0.6%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,556 kB
  • ctags: 1,495
  • sloc: python: 11,807; makefile: 167
file content (21 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Assorted runtime unit tests
"""
from mako import runtime
import unittest
from test import eq_

class ContextTest(unittest.TestCase):
    def test_locals_kwargs(self):
        c = runtime.Context(None, foo='bar')
        eq_(c.kwargs, {'foo': 'bar'})

        d = c._locals({'zig': 'zag'})

        # kwargs is the original args sent to the Context,
        # it's intentionally kept separate from _data
        eq_(c.kwargs, {'foo': 'bar'})
        eq_(d.kwargs, {'foo': 'bar'})

        eq_(d._data['zig'], 'zag')