From c081af569064c3e3f5661040224c516584071788 Mon Sep 17 00:00:00 2001 From: M Pacer Date: Fri, 23 Mar 2018 11:30:03 -0700 Subject: [PATCH] add other markdown string conversion examples for test --- notebook/tests/selenium/test_markdown.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/notebook/tests/selenium/test_markdown.py b/notebook/tests/selenium/test_markdown.py index ff6c5c7ad..df95d57b2 100644 --- a/notebook/tests/selenium/test_markdown.py +++ b/notebook/tests/selenium/test_markdown.py @@ -8,7 +8,7 @@ from .utils import wait_for_selector, Notebook pjoin = os.path.join -@pytest.fixture(scope='module') +@pytest.fixture def notebook(authenticated_browser): return Notebook.new_notebook(authenticated_browser) @@ -22,15 +22,23 @@ def get_rendered_contents(nb): for x in rendered_cells if x is not None] + def test_markdown_cell(notebook): nb = notebook - cell_text = ["# Foo"] - expected_contents = ['

Foo

'] + cell_text = ["# Foo", + '**Bar**', + '*Baz*', + '```\nx = 1\n```', + '```aaaa\nx = 1\n```', + ] + expected_contents = ['

Foo

', + '

Bar

', + '

Baz

', + '
x = 1\n
', + '
x = 1\n
' + ] for i, cell in enumerate(nb): - if i==0: - nb.convert_cell_type(0, cell_type="markdown") - nb[0] = cell_text[0] - nb.append(cell_text[1:], cell_type="markdown") + nb.append(*cell_text, cell_type="markdown") nb.run_all() rendered_contents = get_rendered_contents(nb) assert rendered_contents == expected_contents