Beispiel #1
0
def test_process_dd():
    soup = BeautifulSoup(open(os.path.join(HERE, 'dd_example.html')))
    assert (list(sphinx._process_dd('__call__()', soup)) ==
            DD_EXAMPLE_PARSE_RESULT)
    assert list(sphinx._process_dd(
        'foo()',
        BeautifulSoup('<dd><dl><dt>doesntmatchanything</dt></dl><dd>'))) == []
Beispiel #2
0
def test_process_dd():
    soup = BeautifulSoup(open(os.path.join(HERE, 'dd_example.html')))
    assert (list(sphinx._process_dd('__call__()',
                                    soup)) == DD_EXAMPLE_PARSE_RESULT)
    assert list(
        sphinx._process_dd(
            'foo()',
            BeautifulSoup(
                '<dd><dl><dt>doesntmatchanything</dt></dl><dd>'))) == []
Beispiel #3
0
def test_process_dd():
    soup = BeautifulSoup(open(os.path.join(HERE, "dd_example.html")))
    assert list(sphinx._process_dd("__call__()", soup)) == DD_EXAMPLE_PARSE_RESULT
    assert list(sphinx._process_dd("foo()", BeautifulSoup("<dd><dl><dt>doesntmatchanything</dt></dl><dd>"))) == []
Beispiel #4
0
 def test_failure(self):
     assert list(sphinx._process_dd(
         u'foo()',
         BeautifulSoup(u'<dd><dl><dt>doesntmatchanything</dt></dl><dd>'))
     ) == []
Beispiel #5
0
 def test_success(self):
     soup = BeautifulSoup(open(os.path.join(HERE, 'dd_example.html')))
     assert (list(sphinx._process_dd(u'__call__()', soup)) ==
             DD_EXAMPLE_PARSE_RESULT)