test-ein-console.el 1.1 KB

1234567891011121314151617181920212223242526
  1. (require 'ein-console)
  2. (ert-deftest ein:console-security-dir-string ()
  3. (let ((ein:console-security-dir "/some/dir/"))
  4. (should (equal (ein:console-security-dir-get "DUMMY-URL-OR-PORT")
  5. ein:console-security-dir))))
  6. (ert-deftest ein:console-security-dir-list ()
  7. (let ((ein:console-security-dir
  8. '((8888 . "/dir/8888/")
  9. ("htttp://dummy.org" . "/dir/http/")
  10. (7777 . my-secret-directory)
  11. (default . "/dir/default/")))
  12. (my-secret-directory "/dir/secret/"))
  13. (should (equal (ein:console-security-dir-get 8888) "/dir/8888/"))
  14. (should (equal (ein:console-security-dir-get "htttp://dummy.org")
  15. "/dir/http/"))
  16. (should (equal (ein:console-security-dir-get 7777) "/dir/secret/"))
  17. (should (equal (ein:console-security-dir-get 9999) "/dir/default/"))))
  18. (ert-deftest ein:console-security-dir-func ()
  19. (let ((ein:console-security-dir
  20. '(lambda (x) (should (equal x "DUMMY-URL-OR-PORT")) "/dir/")))
  21. (should (equal (ein:console-security-dir-get "DUMMY-URL-OR-PORT")
  22. "/dir/"))))