Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

40 řádky
816 B

  1. package iam_test
  2. import (
  3. "github.com/goamz/goamz/aws"
  4. "github.com/goamz/goamz/iam"
  5. "github.com/goamz/goamz/iam/iamtest"
  6. . "gopkg.in/check.v1"
  7. )
  8. // LocalServer represents a local ec2test fake server.
  9. type LocalServer struct {
  10. auth aws.Auth
  11. region aws.Region
  12. srv *iamtest.Server
  13. }
  14. func (s *LocalServer) SetUp(c *C) {
  15. srv, err := iamtest.NewServer()
  16. c.Assert(err, IsNil)
  17. c.Assert(srv, NotNil)
  18. s.srv = srv
  19. s.region = aws.Region{IAMEndpoint: srv.URL()}
  20. }
  21. // LocalServerSuite defines tests that will run
  22. // against the local iamtest server. It includes
  23. // tests from ClientTests.
  24. type LocalServerSuite struct {
  25. srv LocalServer
  26. ClientTests
  27. }
  28. var _ = Suite(&LocalServerSuite{})
  29. func (s *LocalServerSuite) SetUpSuite(c *C) {
  30. s.srv.SetUp(c)
  31. s.ClientTests.iam = iam.New(s.srv.auth, s.srv.region)
  32. }