mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 17:41:40 -05:00
31 lines
1.3 KiB
EmacsLisp
31 lines
1.3 KiB
EmacsLisp
![]() |
(eval-when-compile (require 'cl))
|
||
|
(require 'ert)
|
||
|
|
||
|
(require 'ein-notification)
|
||
|
|
||
|
(ert-deftest ein-header-line-kernel-status-busy ()
|
||
|
(let* ((ein:@notification (ein:notification "NotificationTest"))
|
||
|
(kernel (oref ein:@notification :kernel)))
|
||
|
(ein:notification-status-set kernel
|
||
|
'(status_busy . Kernel))
|
||
|
(should (equal (ein:header-line) "IP[y]: Kernel is busy..."))))
|
||
|
|
||
|
(ert-deftest ein-header-line-notebook-status-busy ()
|
||
|
(let* ((ein:@notification (ein:notification "NotificationTest"))
|
||
|
(notebook (oref ein:@notification :notebook)))
|
||
|
(ein:notification-status-set notebook
|
||
|
'(notebook_saved . Notebook))
|
||
|
(should (equal (ein:header-line) "IP[y]: Notebook is saved"))))
|
||
|
|
||
|
(ert-deftest ein-header-line-notebook-complex ()
|
||
|
(let* ((ein:@notification (ein:notification "NotificationTest"))
|
||
|
(kernel (oref ein:@notification :kernel))
|
||
|
(notebook (oref ein:@notification :notebook)))
|
||
|
(ein:notification-status-set kernel
|
||
|
'(status_dead . Kernel))
|
||
|
(ein:notification-status-set notebook
|
||
|
'(notebook_saving . Notebook))
|
||
|
(should (equal
|
||
|
(ein:header-line)
|
||
|
"IP[y]: Saving Notebook... | Kernel is dead. Need restart."))))
|