2018-10-11 16:53:02 -04:00
|
|
|
(eval-when-compile (require 'cl))
|
2018-09-26 10:25:48 -04:00
|
|
|
(require 'f)
|
|
|
|
(require 'espuds)
|
|
|
|
(require 'ert)
|
|
|
|
|
|
|
|
(let* ((support-path (f-dirname load-file-name))
|
|
|
|
(root-path (f-parent (f-parent support-path))))
|
|
|
|
(add-to-list 'load-path (concat root-path "/lisp"))
|
|
|
|
(add-to-list 'load-path (concat root-path "/test")))
|
|
|
|
|
|
|
|
(require 'ein-notebooklist)
|
|
|
|
(require 'ein-jupyter)
|
|
|
|
(require 'ein-dev)
|
|
|
|
(require 'ein-testing)
|
|
|
|
|
|
|
|
(defvar ein:testing-jupyter-server-root (f-parent (f-dirname load-file-name)))
|
|
|
|
|
2018-10-01 18:40:31 -04:00
|
|
|
(defun ein:testing-after-scenario ()
|
2018-10-11 16:53:02 -04:00
|
|
|
(ein:testing-flush-queries)
|
2018-10-15 16:57:22 -04:00
|
|
|
(with-current-buffer (ein:notebooklist-get-buffer (car (ein:jupyter-server-conn-info)))
|
2018-10-11 16:53:02 -04:00
|
|
|
(let ((urlport (ein:$notebooklist-url-or-port ein:%notebooklist%)))
|
|
|
|
(loop for notebook in (ein:notebook-opened-notebooks)
|
|
|
|
for path = (ein:$notebook-notebook-path notebook)
|
|
|
|
do (ein:notebook-kill-kernel-then-close-command notebook t)
|
|
|
|
(if (search "Untitled" path )
|
|
|
|
(ein:notebooklist-delete-notebook path)))))
|
|
|
|
(ein:testing-flush-queries))
|
|
|
|
|
2018-10-01 18:40:31 -04:00
|
|
|
(Setup
|
|
|
|
(ein:dev-start-debug)
|
2018-10-12 10:58:59 -05:00
|
|
|
(setq ein:notebook-autosave-frequency 0)
|
2018-10-13 13:09:17 -04:00
|
|
|
(setq ein:populate-hierarchy-on-notebooklist-open t)
|
2018-10-01 18:40:31 -04:00
|
|
|
(setq ein:testing-dump-file-log (concat default-directory "log/ecukes.log"))
|
|
|
|
(setq ein:testing-dump-file-messages (concat default-directory "log/ecukes.messages"))
|
|
|
|
(setq ein:testing-dump-file-server (concat default-directory "log/ecukes.server"))
|
|
|
|
(setq ein:testing-dump-file-request (concat default-directory "log/ecukes.request"))
|
2018-10-15 16:57:22 -04:00
|
|
|
(Given "I start and login to the server configured \"\\n\"")
|
|
|
|
)
|
2018-10-01 18:40:31 -04:00
|
|
|
|
|
|
|
(After
|
|
|
|
(ein:testing-after-scenario))
|
2018-09-26 10:25:48 -04:00
|
|
|
|
|
|
|
(Teardown
|
2018-10-11 16:53:02 -04:00
|
|
|
(cl-letf (((symbol-function 'y-or-n-p) #'ignore))
|
2018-10-15 16:57:22 -04:00
|
|
|
(ein:jupyter-server-stop t)))
|
2018-09-26 10:25:48 -04:00
|
|
|
|
|
|
|
(Fail
|
2018-10-01 18:40:31 -04:00
|
|
|
(if noninteractive
|
|
|
|
(ein:testing-after-scenario)
|
|
|
|
(keyboard-quit))) ;; useful to prevent emacs from quitting
|