You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

32 lines
566 B

  1. package testutil
  2. import (
  3. "flag"
  4. "github.com/goamz/goamz/aws"
  5. . "gopkg.in/check.v1"
  6. )
  7. // Amazon must be used by all tested packages to determine whether to
  8. // run functional tests against the real AWS servers.
  9. var Amazon bool
  10. func init() {
  11. flag.BoolVar(&Amazon, "amazon", false, "Enable tests against amazon server")
  12. }
  13. type LiveSuite struct {
  14. auth aws.Auth
  15. }
  16. func (s *LiveSuite) SetUpSuite(c *C) {
  17. if !Amazon {
  18. c.Skip("amazon tests not enabled (-amazon flag)")
  19. }
  20. auth, err := aws.EnvAuth()
  21. if err != nil {
  22. c.Fatal(err.Error())
  23. }
  24. s.auth = auth
  25. }