emacs-ipython-notebook/test/test-ein-notebooklist.el
John Miller 9d5309af59 Trying something new with testing.
Let's do this with ert-runner instead of python. Maybe it will work for once.
2018-02-27 14:38:13 -06:00

24 lines
977 B
EmacsLisp
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(require 'ein-notebooklist)
(defun eintest:notebooklist-make-empty (&optional url-or-port)
"Make empty notebook list buffer."
(ein:notebooklist-url-retrieve-callback (or url-or-port "DUMMY-URL")
(ein:query-ipython-version)
""))
(defmacro eintest:notebooklist-is-empty-context-of (func)
`(ert-deftest ,(intern (format "%s--notebooklist" func)) ()
(with-current-buffer (eintest:notebooklist-make-empty)
(should-not (,func)))))
;; Generic getter
(ert-deftest ein:get-url-or-port--notebooklist ()
(with-current-buffer (eintest:notebooklist-make-empty "DUMMY-URL")
(should (equal (ein:get-url-or-port) "DUMMY-URL"))))
(eintest:notebooklist-is-empty-context-of ein:get-notebook)
(eintest:notebooklist-is-empty-context-of ein:get-kernel)
(eintest:notebooklist-is-empty-context-of ein:get-cell-at-point)
(eintest:notebooklist-is-empty-context-of ein:get-traceback-data)