예제 #1
0
 def test_escape_href_link(self):
     style = ReSTStyle(ReSTDocument())
     style.start_a(attrs=[('href', 'http://example.org')])
     style.doc.write('foo: the next bar')
     style.end_a()
     self.assertEqual(style.doc.getvalue(),
                      six.b('`foo\\: the next bar <http://example.org>`_ '))
예제 #2
0
 def test_href_link(self):
     style = ReSTStyle(ReSTDocument())
     style.start_a(attrs=[('href', 'http://example.org')])
     style.doc.write('example')
     style.end_a()
     self.assertEqual(style.doc.getvalue(),
                      six.b('`example <http://example.org>`_ '))
예제 #3
0
파일: test_style.py 프로젝트: boto/botocore
 def test_escape_href_link(self):
     style = ReSTStyle(ReSTDocument())
     style.start_a(attrs=[('href', 'http://example.org')])
     style.doc.write('foo: the next bar')
     style.end_a()
     self.assertEqual(
         style.doc.getvalue(),
         six.b('`foo\\: the next bar <http://example.org>`__ '))
예제 #4
0
파일: test_style.py 프로젝트: boto/botocore
 def test_href_link(self):
     style = ReSTStyle(ReSTDocument())
     style.start_a(attrs=[('href', 'http://example.org')])
     style.doc.write('example')
     style.end_a()
     self.assertEqual(
         style.doc.getvalue(),
         six.b('`example <http://example.org>`__ ')
     )
예제 #5
0
 def test_handle_no_text_hrefs(self):
     style = ReSTStyle(ReSTDocument())
     style.start_a(attrs=[('href', 'http://example.org')])
     style.end_a()
     self.assertEqual(style.doc.getvalue(),
                      six.b('`<http://example.org>`_ '))