|
@@ -0,0 +1,52 @@
|
|
|
+
|
|
|
+
|
|
|
+(load "/Users/jwd/code/photo-gal/photogal.el")
|
|
|
+
|
|
|
+(setq photogaltest-example-operating-table
|
|
|
+ '(("/Photos/comp.png"
|
|
|
+ (nil nil))
|
|
|
+ ("/Photos/e06de5-5501,240622--_art_computer_good_meme_photography_politics_portrait_reaction-photo_screenshot_selfie_.png"
|
|
|
+ (nil nil))
|
|
|
+ ("/Photos/e99e1a-5501,240622-como-_art_cityscape_computer_family_meme_politics_reaction-photo_screenshot_selfie_.jpg"
|
|
|
+ (nil nil))
|
|
|
+ ("/Photos/rsf.png"
|
|
|
+ (nil 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")
|
|
|
+ '()))))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+(ert-deftest folder-sorting-test ()
|
|
|
+
|
|
|
+ (let
|
|
|
+ ((*photogal/operating-table*
|
|
|
+ photogaltest-example-operating-table))
|
|
|
+
|
|
|
+ (should (eq (photogal-get-folder-for-file "/Photos/comp.png")
|
|
|
+ ""))
|
|
|
+
|
|
|
+ ))
|
|
|
+
|
|
|
+
|