import IPython.nbformat.current as nbformat

from nbdiff.merge import (
    notebook_merge,
)


# Regression test for bug #196
def test_empty_notebook():
    notebook = nbformat.new_notebook()
    notebook2 = nbformat.new_notebook()
    notebook3 = nbformat.new_notebook()
    result = notebook_merge(notebook, notebook2, notebook3)
    assert result['metadata']['nbdiff-type'] == 'merge'


def test_basic_merge():
    notebook = nbformat.new_notebook()
    code_cell = nbformat.new_code_cell(input=['a', 'b'])
    notebook['worksheets'] = [
        {'cells': [code_cell]}
    ]
    notebook2 = nbformat.new_notebook()
    notebook3 = nbformat.new_notebook()
    code_cell = nbformat.new_code_cell(input=['a', 'b'])
    notebook3['worksheets'] = [
        {'cells': [code_cell]}
    ]
    print notebook, notebook2, notebook3
    result = notebook_merge(notebook, notebook2, notebook3)
    result_cells = result['worksheets'][0]['cells']
    print result_cells
    state = result_cells[0]['metadata']['state']
    assert state == 'added'

@@ -782,49 +782,8 @@
   %5D%0A
-    print notebook, notebook2, notebook3%0A
     
@@ -894,31 +894,8 @@
 s'%5D%0A
-    print result_cells%0A
     

Remove print statements