- commit
- a4617a3c44672095343d9b57d7afe09063212606
- parent
- 4cc646a1840f0b06d97d6753e0b33f2dd74ce55b
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2021-07-04 12:48
rm broken code from tests
Diffstat
| M | tests.py | 18 | +++--------------- |
1 files changed, 3 insertions, 15 deletions
diff --git a/tests.py b/tests.py
@@ -2,7 +2,6 @@ import json 2 2 import unittest 3 3 from html import escape 4 4 from pathlib import Path5 -1 from unittest.mock import patch6 5 7 6 import stache 8 7 @@ -12,20 +11,9 @@ IGNORED = ['delimiters.json', '~inheritance.json', '~partials.json'] 12 11 def generate_test(test, filename): 13 12 class TestCase(unittest.TestCase): 14 13 def runTest(self):15 -1 def _get_template(key, indent=''):16 -1 try:17 -1 s = test['partials'][key]18 -1 s = stache.add_indent(s, indent)19 -1 return stache.parse(s, key)20 -1 except KeyError:21 -1 return []22 -123 -1 with patch('stache.get_template') as get_template:24 -1 get_template.side_effect = _get_template25 -126 -1 nodes = stache.parse(test['template'], '')27 -1 html = stache.render(nodes, test['data'], escape)28 -1 self.assertEqual(html, test['expected'])-1 14 nodes = stache.parse(test['template'], '') -1 15 html = stache.render(nodes, test['data'], escape) -1 16 self.assertEqual(html, test['expected']) 29 17 30 18 def __str__(self): 31 19 return f'{filename} - {test["name"]}'