Skip to content

Instantly share code, notes, and snippets.

@joatmon08
Last active May 2, 2019 19:54
Show Gist options
  • Select an option

  • Save joatmon08/a573fc309d237b690afbff7e08b67b32 to your computer and use it in GitHub Desktop.

Select an option

Save joatmon08/a573fc309d237b690afbff7e08b67b32 to your computer and use it in GitHub Desktop.
TDD-Infra-bucket-01
package test
import (
"testing"
"github.com/stretchr/testify/assert"
)
const BucketPolicyFilePath = "../../policies/bucket.json"
func TestPolicyHasVersionAndID(t *testing.T) {
policy := setup(t, BucketPolicyFilePath)
assert.Equal(t, "2012-10-17", policy.Version)
assert.Equal(t, "MyBucketPolicy", policy.ID)
assert.Equal(t, 3, len(policy.Statement))
assert.Equal(t, "AllowWriteUser", policy.Statement[0].Sid)
assert.Equal(t, "AllowReadUser", policy.Statement[1].Sid)
assert.Equal(t, "AllowAdminRole", policy.Statement[2].Sid)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment