(ert-deftest elpy-rpc--register-callback-should-fail-in-bad-buffer ()
  (elpy-testcase ()
    (should-error (elpy-rpc--register-callback 0 'promise))))

(ert-deftest elpy-rpc--register-callback-should-initialize-callbacks ()
  (elpy-testcase ()
    (setq elpy-rpc--buffer-p t)
    (elpy-rpc--register-callback 0 'promise)
    (should (hash-table-p elpy-rpc--backend-callbacks))))

(ert-deftest elpy-rpc--register-callback-should-add-values ()
  (elpy-testcase ()
    (setq elpy-rpc--buffer-p t)
    (elpy-rpc--register-callback 0 'promise)
    (should (eq (gethash 0 elpy-rpc--backend-callbacks)
                'promise))))
