コード例 #1
0
ファイル: test_style.py プロジェクト: boto/bcdoc
 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`_ \n\n.. _foo\\: the next '
               'bar: http://example.org\n'))
コード例 #2
0
ファイル: test_style.py プロジェクト: movermeyer/bcdoc
 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`_ \n\n.. _foo\\: the next '
               'bar: http://example.org\n'))
コード例 #3
0
ファイル: test_style.py プロジェクト: boto/bcdoc
 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>`_ '))
コード例 #4
0
ファイル: test_style.py プロジェクト: movermeyer/bcdoc
 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>`_ '))