diff options
Diffstat (limited to 'vendor/github.com/goamz/goamz/testutil/suite.go')
-rw-r--r-- | vendor/github.com/goamz/goamz/testutil/suite.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/github.com/goamz/goamz/testutil/suite.go b/vendor/github.com/goamz/goamz/testutil/suite.go new file mode 100644 index 000000000..f4519aa4e --- /dev/null +++ b/vendor/github.com/goamz/goamz/testutil/suite.go @@ -0,0 +1,31 @@ +package testutil + +import ( + "flag" + + "github.com/goamz/goamz/aws" + . "gopkg.in/check.v1" +) + +// Amazon must be used by all tested packages to determine whether to +// run functional tests against the real AWS servers. +var Amazon bool + +func init() { + flag.BoolVar(&Amazon, "amazon", false, "Enable tests against amazon server") +} + +type LiveSuite struct { + auth aws.Auth +} + +func (s *LiveSuite) SetUpSuite(c *C) { + if !Amazon { + c.Skip("amazon tests not enabled (-amazon flag)") + } + auth, err := aws.EnvAuth() + if err != nil { + c.Fatal(err.Error()) + } + s.auth = auth +} |