-;; Copyright (c) 2007-2013 Basho Technologies, Inc.  All Rights Reserved.
+;; Copyright (c) 2007-2015 Basho Technologies, Inc.  All Rights Reserved.
 ;;
 ;; This file is provided to you under the Apache License,
 ;; Version 2.0 (the "License"); you may not use this file

      wrong-md5 "2945d7de2f70de5b8c0cb3fbcba4fe92"]
  (fact "Bad content md5 throws an exception"
        (with-random-cred c
          (do
            (s3/create-bucket c bucket-name)
            (s3/put-object c bucket-name object-name value
                           {:content-md5 wrong-md5})))
        => (throws AmazonS3Exception)))

(def bad-canonical-id

      => [])

(let [bucket-name (random-string)]
  (fact "creating a bucket should list one bucket in list buckets"
        (with-random-cred c
          (s3/create-bucket c bucket-name)
          (map :name (s3/list-buckets c))
        => [bucket-name])))

(let [bucket-name (random-string)
      object-name (random-string)]
  (fact "simple put works"
        (with-random-cred cred
          (s3/create-bucket cred bucket-name)
          (s3/put-object cred bucket-name object-name
                         "contents"))
        => truthy))

(let [bucket-name (random-string)
      object-name (random-string)
      value "this is the value!"]
  (fact "the value received during GET is the same
         as the object that was PUT"
        (with-random-cred c
          (s3/create-bucket c bucket-name)
          (s3/put-object c bucket-name object-name value)
          ((comp slurp :content) (s3/get-object c bucket-name object-name)))
        => value))

(let [bucket-name (random-string)
