def test_mfile_to_lines():
    lines = publish.mfile_to_lines(MFILE)

    nb = publish.lines_to_notebook(lines)

    npt.assert_equal(
        nb['cells'][1]['source'][0],
        ' Experimenting with conversion from matlab to ipynb\n\n')
def test_lines_to_notebook():
    """
    Test that conversion of some lines gives you a proper notebook
    """

    lines = [
        "%% This is a first line\n", "\n",
        "% This should be in another cell\n", "a = 1; % This is code\n",
        "b = 2; % This is also code\n", "c = 3; % code in another cell\n"
    ]

    nb = publish.lines_to_notebook(lines)

    npt.assert_equal(nb['cells'][1]['source'][0], ' This is a first line\n\n')
def test_lines_to_notebook():
    """
    Test that conversion of some lines gives you a proper notebook
    """

    lines  = ["%% This is a first line\n",
              "\n",
              "% This should be in another cell\n",
              "a = 1; % This is code\n",
              "b = 2; % This is also code\n",
              "c = 3; % code in another cell\n"]

    nb = publish.lines_to_notebook(lines)

    npt.assert_equal(nb['worksheets'][0]['cells'][0]['source'][0],
                     ' This is a first line\n\n')
def test_lines_to_notebook():
    """
    Test that conversion of some lines gives you a proper notebook
    """

    lines = [
        "%% This is a first line\n",
        "\n",
        "% This should be in another cell\n",
        "a = 1; % This is code\n",
        "b = 2; % This is also code\n",
        "c = 3; % code in another cell\n",
    ]

    nb = publish.lines_to_notebook(lines)

    npt.assert_equal(nb["cells"][1]["source"][0], " This is a first line\n\n")
def test_mfile_to_lines():
    lines = publish.mfile_to_lines(MFILE)

    nb = publish.lines_to_notebook(lines)

    npt.assert_equal(nb["cells"][1]["source"][0], " Experimenting with conversion from matlab to ipynb\n\n")