コード例 #1
0
ファイル: test_view.py プロジェクト: dinoboff/pystache
 def test_template_load_from_multiple_path(self):
     view = Simple(thing='world')
     view.template_path = [
         os.path.join(view.template_path, 'nowhere'),
         view.template_path
         ]
     self.assertEquals(view.render(), "Hi world!")
コード例 #2
0
ファイル: test_view.py プロジェクト: dinoboff/pystache
 def test_basic(self):
     view = Simple("Hi {{thing}}!", { 'thing': 'world' })
     self.assertEquals(view.render(), "Hi world!")
コード例 #3
0
ファイル: test_view.py プロジェクト: dinoboff/pystache
 def test_view_instances_as_attributes(self):
     other = Simple(name='chris')
     other.template = '{{name}}'
     view = Simple()
     view.thing = other
     self.assertEquals(view.render(), "Hi chris!")
コード例 #4
0
ファイル: test_view.py プロジェクト: dinoboff/pystache
 def test_non_callable_attributes(self):
     view = Simple()
     view.thing = 'Chris'
     self.assertEquals(view.render(), "Hi Chris!")
コード例 #5
0
ファイル: test_view.py プロジェクト: dinoboff/pystache
 def test_basic_method_calls(self):
     view = Simple()
     self.assertEquals(view.render(), "Hi pizza!")
コード例 #6
0
ファイル: test_view.py プロジェクト: dinoboff/pystache
 def test_template_load(self):
     view = Simple(thing='world')
     self.assertEquals(view.render(), "Hi world!")
コード例 #7
0
ファイル: test_view.py プロジェクト: dinoboff/pystache
 def test_kwargs(self):
     view = Simple("Hi {{thing}}!", thing='world')
     self.assertEquals(view.render(), "Hi world!")