From 8edcb1cff04c39a5e7d9e3a97a8ab28ffcf86f81 Mon Sep 17 00:00:00 2001 From: Nathaniel Nicandro Date: Wed, 31 Oct 2018 21:59:48 -0500 Subject: [PATCH] Simplify `jupyter-channel` tests --- jupyter-tests.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/jupyter-tests.el b/jupyter-tests.el index ede6fa9..d9a75d7 100644 --- a/jupyter-tests.el +++ b/jupyter-tests.el @@ -308,7 +308,7 @@ running BODY." ;; Lock file names are based on session IDs (oset client session (jupyter-session)) (unwind-protect - (with-current-buffer (oref client -buffer) + (jupyter-with-client-buffer client (should (not buffer-file-name)) (let ((lock (jupyter--ioloop-lock-file client))) (should (file-locked-p lock)) @@ -332,17 +332,14 @@ running BODY." (ert-info ("Starting the channel") (should-not (jupyter-channel-alive-p channel)) (jupyter-start-channel channel :identity "foo") - (should (zmq-socket-p (oref channel socket))) + (should (jupyter-channel-alive-p channel)) (should (equal (zmq-socket-get (oref channel socket) zmq-ROUTING-ID) - "foo")) - (should (jupyter-channel-alive-p channel))) + "foo"))) (ert-info ("Stopping the channel") (let ((sock (oref channel socket))) (jupyter-stop-channel channel) - (should (not (oref channel socket))) - (should-error (zmq-send sock "foo") - :type 'zmq-ENOTSOCK))))) + (should-error (zmq-send sock "foo") :type 'zmq-ENOTSOCK))))) (ert-info ("Asynchronous channels") (let* ((channel (jupyter-async-channel :type :shell