Created
June 3, 2019 06:52
-
-
Save erez-rabih/056f780080c3e02e48ffabc9bac86b6d to your computer and use it in GitHub Desktop.
tighter mock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest get-file-metadata-test | |
(let [example-bucket "some-bucket" | |
example-filename "some-file" | |
example-metadata {:example "valid metadata"}] | |
(testing "should return file metadata in case file exists" | |
(with-redefs [s3/get-object (fn [& {:keys [bucket-name key]}] | |
(when (and | |
(= bucket-name example-bucket) | |
(= key example-filename)) | |
example-metadata))] | |
(is (= example-metadata (get-file-metadata example-bucket example-filename))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment