Skip to content

Commit c715176

Browse files
committed
Use jupyter-org-get-result when getting inline source block results.
This has been the correct name for the function since c799c25. Also fix the associated unit test. `jupyter-org-request`s must include a non-nil :marker otherwise `jupyter-org-with-point-at` will error.
1 parent 3615c2d commit c715176

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ob-jupyter.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ These parameters are handled internally."
522522
;; :execute-result will be in `jupyter-org-request-results' since
523523
;; stream results and any displayed data will be placed in a separate
524524
;; buffer.
525-
(let ((el (jupyter-org-result
525+
(let ((el (jupyter-org-get-result
526526
req (car (jupyter-org-request-results req)))))
527527
(if (stringp el) el
528528
(org-element-property :value el)))

test/jupyter-test.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,20 +2103,20 @@ Image(filename='%s', width=300)" file)
21032103
(when (file-exists-p image-file-name)
21042104
(delete-file image-file-name)))))
21052105

2106-
(ert-deftest jupyter-org-result ()
2106+
(ert-deftest jupyter-org-get-result ()
21072107
:tags '(org)
2108-
(let ((req (jupyter-org-request)))
2109-
(let ((res (jupyter-org-result req (list :text/plain "foo"))))
2108+
(let ((req (jupyter-org-request :marker (jupyter-org-test (point-marker)))))
2109+
(let ((res (jupyter-org-get-result req (list :text/plain "foo"))))
21102110
(should (eq (org-element-type res) 'fixed-width))
21112111
(should (equal (org-element-property :value res) "foo")))
2112-
(let ((res (jupyter-org-result req (list :text/html "foo"))))
2112+
(let ((res (jupyter-org-get-result req (list :text/html "foo"))))
21132113
(should (eq (org-element-type res) 'export-block))
21142114
(should (equal (org-element-property :type res) "html"))
21152115
(should (equal (org-element-property :value res) "foo\n")))
21162116
;; Calls `org-babel-script-escape' for scalar data
2117-
(should (equal (jupyter-org-result req (list :text/plain "[1, 2, 3]"))
2117+
(should (equal (jupyter-org-get-result req (list :text/plain "[1, 2, 3]"))
21182118
"| 1 | 2 | 3 |\n"))
2119-
(let ((res (jupyter-org-result req (list :text/plain "[1, 2, 3] Foo"))))
2119+
(let ((res (jupyter-org-get-result req (list :text/plain "[1, 2, 3] Foo"))))
21202120
(should (eq (org-element-type res) 'fixed-width))
21212121
(should (equal (org-element-property :value res) "[1, 2, 3] Foo")))))
21222122

0 commit comments

Comments
 (0)