def test_join(self):
     assert Protected(' ').join(['a', Protected('b c')]).render_as('latex') == 'a{ b c}'
     assert Protected(nbsp).join(['a', 'b', 'c']).render_as('latex') == 'a{~}b{~}c'
     assert nbsp.join(['a', Protected('b'), 'c']).render_as('latex') == 'a~{b}~c'
     assert String('-').join([Protected('a'), Protected('b'), Protected('c')]).render_as('latex') == '{a}-{b}-{c}'
     result = Protected(' and ').join(['a', 'b', 'c']).render_as('latex')
     assert result == 'a{ and }b{ and }c'
Esempio n. 2
0
 def test_join(self):
     assert Protected(' ').join(['a', Protected('b c')]).render_as('latex') == 'a{ b c}'
     assert Protected(nbsp).join(['a', 'b', 'c']).render_as('latex') == 'a{~}b{~}c'
     assert nbsp.join(['a', Protected('b'), 'c']).render_as('latex') == 'a~{b}~c'
     assert String('-').join([Protected('a'), Protected('b'), Protected('c')]).render_as('latex') == '{a}-{b}-{c}'
     result = Protected(' and ').join(['a', 'b', 'c']).render_as('latex')
     assert result == 'a{ and }b{ and }c'
 def test_join(self):
     assert unicode(Text(' ').join(['a', Text('b c')])) == 'a b c'
     assert unicode(Text(nbsp).join(['a', 'b', 'c'])) == 'a<nbsp>b<nbsp>c'
     assert unicode(nbsp.join(['a', 'b', 'c'])) == 'a<nbsp>b<nbsp>c'
     assert unicode(String('-').join(['a', 'b', 'c'])) == 'a-b-c'
     result = Tag('em', ' and ').join(['a', 'b', 'c']).render_as('html')
     assert result == 'a<em> and </em>b<em> and </em>c'
     result = HRef('/', ' and ').join(['a', 'b', 'c']).render_as('html')
     assert result == 'a<a href="/"> and </a>b<a href="/"> and </a>c'
Esempio n. 4
0
 def test_join(self):
     assert six.text_type(Text(' ').join(['a', Text('b c')])) == 'a b c'
     assert six.text_type(Text(nbsp).join(['a', 'b', 'c'])) == 'a<nbsp>b<nbsp>c'
     assert six.text_type(nbsp.join(['a', 'b', 'c'])) == 'a<nbsp>b<nbsp>c'
     assert six.text_type(String('-').join(['a', 'b', 'c'])) == 'a-b-c'
     result = Tag('em', ' and ').join(['a', 'b', 'c']).render_as('html')
     assert result == 'a<em> and </em>b<em> and </em>c'
     result = HRef('/', ' and ').join(['a', 'b', 'c']).render_as('html')
     assert result == 'a<a href="/"> and </a>b<a href="/"> and </a>c'
 def test_join(self):
     assert nbsp.join(['S.', 'Jerusalem']) == Text('S.', nbsp, 'Jerusalem')
Esempio n. 6
0
 def test_join(self):
     assert nbsp.join(['S.', 'Jerusalem']) == Text('S.', nbsp, 'Jerusalem')