MockAWS.jl

Mocking Framework for AWS.jl
Author JuliaCloud
Popularity
1 Star
Updated Last
1 Year Ago
Started In
February 2021

MockAWS.jl

Mocking Framework for AWS.jl

Overview

This package generates patch functions for all AWS services which define them in the aws-sdk-js repository. It is meant to provide means of testing AWS service functionality without needing to actually generate resources.

Usages

Patches are only available to high-level AWS.jl definitions, and are limited to only services which AWS themselves have defined example outputs.

To use this package you must first define the high-level AWS service, then attach the patches to the module. NOTE: When applying patches, you must use the same name you used when defining the AWS.jl high-level service module.

using AWS
using MockAWS
using Mocking

Mocking.activate()

@service S3
@patches S3

apply(S3.get_object_1_patch) do
  @mock S3.get_object("bucket", "key")
end

Dict{String,Any} with 8 entries:
  "ETag"          => "\"6805f2cfc46c0f04559748bb039d69ae\""
  "LastModified"  => "Thu, 15 Dec 2016 01:19:41 GMT"
  "ContentLength" => "3191"
  "Metadata"      => Dict{String,Any}()
  "AcceptRanges"  => "bytes"
  "VersionId"     => "null"
  "ContentType"   => "image/jpeg"
  "TagCount"      => 2

Contributing

Patches are updated manually by GitHubActions, however if you need to create them manually:

using MockAWS
generate_patches()

License

MIT

Used By Packages

No packages found.