コード例 #1
0
ファイル: test_templates.py プロジェクト: katakumpo/breve4py3
def test_stacks_template():
    """test stacks in template"""
    params = dict(
        title=my_name(),
        message='hello, from breve'
    )
    t = Template(html, root=template_root())
    actual = t.render('index', params, namespace='v')
    expected = expected_output()
    assert actual == expected
    # stack should be empty when we finish
    assert not get_stacks()
コード例 #2
0
ファイル: templates.py プロジェクト: giorgil2/breve
    def test_stacks_template(self):
        '''test stacks in template'''

        vars = dict(title=my_name(), message='hello, from breve')
        t = Template(html, root=template_root())
        actual = t.render('index', vars, namespace='v')
        expected = expected_output()

        try:
            self.assertEqual(actual, expected)
        except AssertionError:
            diff(actual, expected)
            raise

        # stack should be empty when we finish
        self.failUnless(not get_stacks())
コード例 #3
0
ファイル: templates.py プロジェクト: stuffonfire/breve
    def test_stacks_template ( self ):
        '''test stacks in template'''
        
        vars = dict ( 
            title = my_name ( ),
            message = 'hello, from breve'
        )
        t = Template ( html, root = template_root ( ) )
        actual = t.render ( 'index', vars, namespace = 'v' )
        expected = expected_output ( )

        try:
            self.assertEqual ( actual, expected )
        except AssertionError:
            diff ( actual, expected )
            raise

        # stack should be empty when we finish
        self.failUnless ( not get_stacks ( ) )