test-photogal.el 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. (load "/Users/jwd/code/photo-gal/photogal.el")
  2. (setq photogaltest-example-operating-table
  3. '(("/Photos/comp.png"
  4. (nil nil))
  5. ("/Photos/e06de5-5501,240622--_art_computer_good_meme_photography_politics_portrait_reaction-photo_screenshot_selfie_.png"
  6. (nil nil))
  7. ("/Photos/e99e1a-5501,240622-como-_art_cityscape_computer_family_meme_politics_reaction-photo_screenshot_selfie_.jpg"
  8. (nil nil))
  9. ("/Photos/rsf.png"
  10. (nil nil))))
  11. (ert-deftest file-properties-test ()
  12. (let
  13. ((*photogal/operating-table*
  14. photogaltest-example-operating-table))
  15. (should (eq (photogal-get-tags-for-file "/Photos/comp.png")
  16. '()))
  17. (should (eq (photogal-get-name-for-file "/Photos/comp.png")
  18. nil))
  19. ;; ADD THE TAG TO THE SYSTEM
  20. (photogal--add-tag "on" "o")
  21. ;; TOGGLE THE FLAG ON FOR A PHOTO
  22. (photogal-for-file-toggle-tag "/Photos/comp.png" "on")
  23. (should (equal (photogal-get-tags-for-file "/Photos/comp.png")
  24. '("on")))
  25. ;; TOGGLE IT BACK OFF
  26. (photogal-for-file-toggle-tag "/Photos/comp.png" "on")
  27. (should (eq (photogal-get-tags-for-file "/Photos/comp.png")
  28. '()))))
  29. (ert-deftest folder-sorting-test ()
  30. (let
  31. ((*photogal/operating-table*
  32. photogaltest-example-operating-table))
  33. (should (eq (photogal-get-folder-for-file "/Photos/comp.png")
  34. ""))
  35. ))