2012-08-14 22:41:19 +02:00
|
|
|
|
(require 'ein-notebooklist)
|
|
|
|
|
|
|
|
|
|
(defun eintest:notebooklist-make-empty (&optional url-or-port)
|
|
|
|
|
"Make empty notebook list buffer."
|
2014-12-04 10:14:10 -06:00
|
|
|
|
(ein:notebooklist-url-retrieve-callback (or url-or-port "DUMMY-URL")
|
|
|
|
|
(ein:query-ipython-version)
|
|
|
|
|
""))
|
2012-08-14 22:41:19 +02:00
|
|
|
|
|
|
|
|
|
(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)
|