emacs-ipython-notebook/test/test-ein-ob.el
dickmao 0490031ec8 Sane File Navigation
As emacs users we prefer and have the luxury of fuzzy file navigation
via ido and projectile.  From a notebook or notebooklist buffer, the commands

`C-c C-f` ein:file-open
`C-c C-o` ein:notebook-open

offer an ido alternative to point and click navigation.

To populate the ido lists, retrieving the content hierarchy is on by
default.  Two custom variables determine how wide and deep the content query
probes (currently at 2 levels deep and 6 directories wide).  Set both
to zero to turn off.

tkf half finished code to quickly go from local file buffers to notebook
mode via `C-c C-z` or `C-c C-o`.  This is now possible.  EIN will
start the server from a suitable parent directory of the visited file.

Enable ido completion for `notebooklist-login`.

Remove the albatross `ein-loaddefs.el` in favor of more standard
`ein-autoloads.el` that is not git tracked.

Convenience `make install` from git source (local alternative to
melpa).
2018-10-26 18:40:19 -04:00

28 lines
760 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.

(eval-when-compile (require 'cl))
(require 'ert)
(require 'ob-ein)
;; Test utils
;;; This is the content portion of a response fromt he content API.
(defvar eintest:ob-src-block
"#+BEGIN_SRC ein :session 8888/Untitled.ipynb
import sys
a = 14500
b = a+1000
sys.version
#+END_SRC
")
(ert-deftest ein:ob-aware ()
(let ((org-babel-load-languages (quote ((ipython . t) (ein . t)))))
(with-temp-buffer
(save-excursion
(org-mode)
(insert eintest:ob-src-block)
(search-backward "SRC")
(cl-letf (((symbol-function 'ein:org-find-or-open-session) (lambda (&rest args) (make-ein:$notebook))))
(setq python-indent-guess-indent-offset-verbose nil)
(should (call-interactively #'org-edit-special)))))))