summaryrefslogtreecommitdiff
path: root/pystache/tests/test_parser.py
blob: 4aa0959f76e5bde4c37e4f42ddf845e5e28d4366 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# coding: utf-8

"""
Unit tests of parser.py.

"""

import unittest

from pystache.parser import _compile_template_re as make_re


class RegularExpressionTestCase(unittest.TestCase):

    """Tests the regular expression returned by _compile_template_re()."""

    def test_re(self):
        """
        Test getting a key from a dictionary.

        """
        re = make_re()
        match = re.search("b  {{test}}")

        self.assertEqual(match.start(), 1)