mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
Move ein:testing-make-notebook-with-outputs to ein-testing-notebook.el
This commit is contained in:
parent
5bb7ec055c
commit
36c1c24bb6
2 changed files with 13 additions and 12 deletions
|
@ -27,6 +27,7 @@
|
|||
;;; Code:
|
||||
|
||||
(require 'ein-notebook)
|
||||
(require 'ein-testing-cell)
|
||||
|
||||
(defun ein:testing-notebook-from-json (json-string &optional notebook-id)
|
||||
(unless notebook-id (setq notebook-id "NOTEBOOK-ID"))
|
||||
|
@ -81,6 +82,18 @@ The new cell is bound to a variable `cell'."
|
|||
,cell-type nil t)))
|
||||
,@body)))
|
||||
|
||||
(defun ein:testing-make-notebook-with-outputs (list-outputs)
|
||||
"Make a new notebook with cells with output.
|
||||
LIST-OUTPUTS is a list of list of strings (pyout text). Number
|
||||
of LIST-OUTPUTS equals to the number cells to be contained in the
|
||||
notebook."
|
||||
(ein:testing-notebook-make-new
|
||||
nil nil
|
||||
(mapcar (lambda (outputs)
|
||||
(ein:testing-codecell-data
|
||||
nil nil (mapcar #'ein:testing-codecell-pyout-data outputs)))
|
||||
list-outputs)))
|
||||
|
||||
(provide 'ein-testing-notebook)
|
||||
|
||||
;;; ein-testing-notebook.el ends here
|
||||
|
|
|
@ -526,18 +526,6 @@ NO-TRIM is passed to `ein:notebook-split-cell-at-point'."
|
|||
;; Check it worked
|
||||
(ein:testing-test-output-visibility-all t)))
|
||||
|
||||
(defun ein:testing-make-notebook-with-outputs (list-outputs)
|
||||
"Make a new notebook with cells with output.
|
||||
LIST-OUTPUTS is a list of list of strings (pyout text). Number
|
||||
of LIST-OUTPUTS equals to the number cells to be contained in the
|
||||
notebook."
|
||||
(ein:testing-notebook-make-new
|
||||
nil nil
|
||||
(mapcar (lambda (outputs)
|
||||
(ein:testing-codecell-data
|
||||
nil nil (mapcar #'ein:testing-codecell-pyout-data outputs)))
|
||||
list-outputs)))
|
||||
|
||||
(defun ein:testing-assert-cell-output-num (cell num-outputs)
|
||||
(should (ein:codecell-p cell))
|
||||
(should (= (length (oref cell :outputs)) num-outputs)))
|
||||
|
|
Loading…
Add table
Reference in a new issue