# Path: metakernel/tests/utils.py
# def get_kernel(kernel_class=MetaKernel):
#     context = zmq.Context.instance()
#     iopub_socket = context.socket(zmq.PUB)
# 
#     kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
#                           log=get_log())
#     return kernel


from metakernel.tests.utils import get_kernel



def test_plot_magic_backend():
    kernel = get_kernel()
    kernel.do_execute('%plot qt -f svg -s400,200', None)
    assert kernel.plot_settings['width'] == 400
    assert kernel.plot_settings['height'] == 200
    assert kernel.plot_settings['format'] == 'svg'
    assert kernel.plot_settings['backend'] == 'qt'

def test_plot_magic_format():
    kernel = get_kernel()
    kernel.do_execute('%plot qt -f svg -w 500 -h 400 -r 200')
    assert kernel.plot_settings['backend'] == 'qt', kernel.plot_settings
    assert kernel.plot_settings['format'] == 'svg', kernel.plot_settings
    assert kernel.plot_settings['width'] == 500, kernel.plot_settings
    assert kernel.plot_settings['height'] == 400, kernel.plot_settings
    assert kernel.plot_settings['resolution'] == 200, kernel.plot_settings

def test_plot_magic_size():
    kernel = get_kernel()
    kernel.do_execute('%plot qt4 -s 400,200')
    assert kernel.plot_settings['width'] == 400
    assert kernel.plot_settings['height'] == 200
    assert kernel.plot_settings['backend'] == 'qt4', kernel.plot_settings

def test_plot_magic_all():

# Path: metakernel/tests/utils.py
# def get_kernel(kernel_class=MetaKernel):
#     context = zmq.Context.instance()
#     iopub_socket = context.socket(zmq.PUB)
# 
#     kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
#                           log=get_log())
#     return kernel


# Path: metakernel/magics/tests/test_plot_magic.py
from metakernel.tests.utils import get_kernel




def test_plot_magic_backend():
    kernel = get_kernel()
    kernel.do_execute('%plot qt -f svg -s400,200', None)
    assert kernel.plot_settings['width'] == 400
    assert kernel.plot_settings['height'] == 200
    assert kernel.plot_settings['format'] == 'svg'
    assert kernel.plot_settings['backend'] == 'qt'

def test_plot_magic_format():
    kernel = get_kernel()
    kernel.do_execute('%plot qt -f svg -w 500 -h 400 -r 200')
    assert kernel.plot_settings['backend'] == 'qt', kernel.plot_settings
    assert kernel.plot_settings['format'] == 'svg', kernel.plot_settings
    assert kernel.plot_settings['width'] == 500, kernel.plot_settings
    assert kernel.plot_settings['height'] == 400, kernel.plot_settings
    assert kernel.plot_settings['resolution'] == 200, kernel.plot_settings

def test_plot_magic_size():
    kernel = get_kernel()
    kernel.do_execute('%plot qt4 -s 400,200')
    assert kernel.plot_settings['width'] == 400
    assert kernel.plot_settings['height'] == 200
    assert kernel.plot_settings['backend'] == 'qt4', kernel.plot_settings

def test_plot_magic_all():

    kernel = get_kernel()