Skip to content

Commit

Permalink
work around keyword issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ikappaki committed Nov 29, 2024
1 parent 32d05b7 commit df6e860
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/basilisp_kernel/integration/notebook_test.lpy
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
[{:metadata {},
:output_type "execute_result",
:execution_count 1,
:data {(keyword "text/plain") "13"}}],,
:data {(keyword nil "text/plain") "13"}}]
:execution_count 1,
:source "(+ 4 9)",}]
(for [cell cells]
Expand Down Expand Up @@ -85,12 +85,12 @@
(is *notebook*)
(is *client*)
(let [{:keys [cells]} (py->lisp (.execute *client*))]
(is (= {(keyword "text/plain") "39"} (get-in cells [0 :outputs 0 :data])) cells))))
(is (= {(keyword nil "text/plain") "39"} (get-in cells [0 :outputs 0 :data])) cells))))
#_(pp/pprint (with-notebook-test))

(defn code-output-text-get
[cell]
(get-in cell [:outputs 0 :data (keyword "text/plain")]))
(get-in cell [:outputs 0 :data (keyword nil "text/plain")]))

(defn cell-output-get
"Returns the `CELL`'s :outputs in the following format according to their `output_type`:
Expand All @@ -108,7 +108,7 @@
(let [{nm :name text :text} output]
(assoc-in acc [:stream nm] text))
"execute_result"
(let [text (get-in output [:data (keyword "text/plain")])]
(let [text (get-in output [:data (keyword nil "text/plain")])]
(assoc-in acc [:result :text] text))
))
{} (:outputs cell)))
Expand Down Expand Up @@ -160,6 +160,10 @@
(let [out-value-after (-> (.execute-cell *client* (last cells) ** :cell-index 6)
py->lisp
cell-output-get)]
(is (= {:text "1"} (:result out-value-after)) out-value-after))))))))
(is (= {:text "1"} (:result out-value-after)) out-value-after))
)
)
)
)))
#_(pp/pprint (nrepl-server-test))

0 comments on commit df6e860

Please sign in to comment.