1
0
jupyter-imatlab/test_imatlab.py
Markéta Machová 5c9dec329e Accepting request 869049 from home:bnavigator:branches:devel:languages:python:jupyter
- Fix wheel install path for new python-rpm-macros
- pyproject_install already recompiles, no need for second time
- Support testing (if you have MATLAB)

OBS-URL: https://build.opensuse.org/request/show/869049
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/jupyter-imatlab?expand=0&rev=11
2021-02-05 09:21:35 +00:00

62 lines
1.8 KiB
Python

# import re
import jupyter_kernel_test as jkt
class IMatlabTests(jkt.KernelTests):
kernel_name = "imatlab"
language_name = "matlab"
file_extension = ".m"
code_hello_world = "fprintf('hello, world') % some comment"
code_stderr = "fprintf(2, 'oops')"
completion_samples = [
{"text": "matlabroo", "matches": ["matlabroot"]},
# Not including prefix (only `cursor_start:cursor_end`).
{"text": "ls setup.", "matches": ["setup.cfg", "setup.py"]},
]
complete_code_samples = [
"1+1",
"for i=1:3\ni\nend",
# FIXME The following should be considered "invalid", but really all
# that matters is that they are not "incomplete".
"function test_complete",
"function test_complete, end",
"classdef test_complete, end",
]
incomplete_code_samples = [
"for i=1:3",
# FIXME We'd rather consider this as "invalid".
"classdef test_complete",
]
invalid_code_samples = [
"for end",
]
code_display_data = [
{"code": "set(0, 'defaultfigurevisible', 'off'); "
"imatlab_export_fig('print-png'); "
"plot([1, 2]);",
"mime": "image/png"},
]
code_inspect_sample = "help"
# FIXME We actually never send "data" back -- only print it.
# code_generate_error = "[1, 2] + [3, 4, 5];"
# code_execute_result = [
# {"code": "1+1;", "result": ""},
# ]
# FIXME History operations are not tested as (as mentioned in the docs)
# they are unnecessary (re-implemented by the frontends, overly complex).
# supported_history_operations = ["tail", "range", "search"]
# code_history_pattern = [
# re.escape("1+1"),
# ]
# FIXME Not available.
# code_page_something = None
# code_clear_output = None