def test_render_section(): res = rst.render_section( contents=[ rst.render_title('Hello', level=1, as_code=True), rst.render_section( contents=[ rst.render_title('Bye', level=2), rst.render_include_module( path='hello.world', ), 'Some Content', ] ) ] ).strip() expected = """ ``Hello`` ========= Bye --- .. automodule:: hello.world Some Content""".strip() assert res == expected
def test_render_page(): res = rst.render_page( name='foo', parts=[ rst.render_title('Three', level=3), rst.render_include_method( path='foo.BarClass.baz' ) ] ) expected_content_lines = [ 'Three', '~~~~~', '', '.. automethod:: foo.BarClass.baz', ' ', '', ] expected_content = '\n'.join(expected_content_lines) expected = rst.RenderedPage( filename='foo.rst', content=expected_content, title='foo' ) assert res == expected
def test_render_section(): res = rst.render_section(contents=[ rst.render_title('Hello', level=1, as_code=True), rst.render_section(contents=[ rst.render_title('Bye', level=2), rst.render_include_module(path='hello.world', ), 'Some Content', ]) ]).strip() expected = """ ``Hello`` ========= Bye --- .. automodule:: hello.world Some Content""".strip() assert res == expected
def test_render_page(): res = rst.render_page( name='foo', parts=[ rst.render_title('Three', level=3), rst.render_include_method(path='foo.BarClass.baz') ]) expected_content_lines = [ 'Three', '~~~~~', '', '.. automethod:: foo.BarClass.baz', ' ', '', ] expected_content = '\n'.join(expected_content_lines) expected = rst.RenderedPage(filename='foo.rst', content=expected_content, title='foo') assert res == expected