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