-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path__init__.py
29 lines (23 loc) · 949 Bytes
/
__init__.py
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
27
28
29
# -*- coding: utf-8 -*-
import os
import plim
from plim import lexer as l
from plim import syntax
from plim.errors import PlimSyntaxError, ParserNotFound
from .. import TestCaseBase
class TestDjangoSyntax(TestCaseBase):
def setUp(self):
super(TestDjangoSyntax, self).setUp()
self.preprocessor = plim.preprocessor_factory(syntax='django')
def test_conditionals(self):
test_case = 'if'
source = self.get_file_contents(test_case + '_test.plim')
result = self.get_file_contents(test_case + '_result.dtl')
data = self.preprocessor(source)
self.check_relevant_chars(data.strip(), result.strip())
def test_loops(self):
test_case = 'for'
source = self.get_file_contents(test_case + '_test.plim')
result = self.get_file_contents(test_case + '_result.dtl')
data = self.preprocessor(source)
self.check_relevant_chars(data.strip(), result.strip())