示例#1
0
文件: test_std.py 项目: marrow/cinje
	def test_heading_iterator(self, std):
		assert flatten(std.heading(iter(['Wazzit.']), 2)) == '<h2>Wazzit.</h2>\n'
示例#2
0
文件: test_std.py 项目: marrow/cinje
	def test_link(self, std):
		assert flatten(std.link('http://example.com')) == '<a href="http://example.com"></a>'
示例#3
0
文件: test_std.py 项目: marrow/cinje
	def test_heading(self, std):
		assert flatten(std.heading('Allo.')) == '<h1>Allo.</h1>\n'
示例#4
0
文件: test_std.py 项目: marrow/cinje
	def test_span_iterator(self, std):
		assert flatten(std.span(iter(["Yay!"]))) == '<span>Yay!</span>'
示例#5
0
文件: test_std.py 项目: marrow/cinje
	def test_span_protected(self, std):
		assert flatten(std.span("<malicious>")) == '<span>&lt;malicious&gt;</span>'
示例#6
0
文件: test_std.py 项目: marrow/cinje
	def test_span(self, std):
		assert flatten(std.span("Hello!")) == '<span>Hello!</span>'
示例#7
0
文件: test_std.py 项目: marrow/cinje
	def test_div(self, std):
		assert flatten(std.div(foo="bar", data_baz="42")) == '<div data-baz="42" foo="bar">\n</div>\n'
示例#8
0
文件: test_use.py 项目: marrow/cinje
	def test_kwargs(self, tmpl):
		assert flatten(tmpl(producer, name='foo', occupation='bar')) == '\n{"name": "foo", "occupation": "bar"}'
示例#9
0
文件: test_use.py 项目: marrow/cinje
	def test_args(self, tmpl):
		assert flatten(tmpl(producer, 'foo', 'bar')) == "foo, bar\n{}"
示例#10
0
文件: test_use.py 项目: marrow/cinje
	def test_simple(self, tmpl):
		assert flatten(tmpl(producer)) == '\n{}'