12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- (load "/Users/jwd/code/photo-gal/photogal.el")
- (setq photogaltest-example-operating-table
- '((filepath "/Photos/comp.png"
- tags nil name nil folders nil)
- (filepath "/Photos/e06de5-5501,240622--_art_computer_good_meme_photography_politics_portrait_reaction-photo_screenshot_selfie_.png"
- tags nil name nil folders nil)
- (filepath "/Photos/e99e1a-5501,240622-como-_art_cityscape_computer_family_meme_politics_reaction-photo_screenshot_selfie_.jpg"
- tags nil name nil folders)
- (filepath "/Photos/rsf.png"
- tags nil name nil folders nil)))
- (ert-deftest file-properties-test ()
- (let
- ((*photogal/operating-table*
- photogaltest-example-operating-table))
- (should (eq (photogal-get-tags-for-file "/Photos/comp.png")
- '()))
- (should (eq (photogal-get-name-for-file "/Photos/comp.png")
- nil))
- ;; ADD THE TAG TO THE SYSTEM
- (photogal--add-tag "on" "o")
- ;; TOGGLE THE FLAG ON FOR A PHOTO
- (photogal-for-file-toggle-tag "/Photos/comp.png" "on")
- (should (equal (photogal-get-tags-for-file "/Photos/comp.png")
- '("on")))
- ;; TOGGLE IT BACK OFF
- (photogal-for-file-toggle-tag "/Photos/comp.png" "on")
- (should (eq (photogal-get-tags-for-file "/Photos/comp.png")
- '()))))
- (defvar *photogal/operating-photo-dir* nil)
- (ert-deftest destination-folder-test ()
- (let
- ((*photogal/operating-table*
- photogaltest-example-operating-table))
- (should (eq (photogal-get-folders-for-file "/Photos/comp.png")
- '()))
- (photogal-add-folder-for-file "/Photos/comp.png" "Trash")
- (should (equal (photogal-get-folders-for-file "/Photos/comp.png")
- '("Trash")))
- ))
|