Exemplo n.º 1
0
func (s *S) TestGetAuthEnv(c *C) {
	os.Clearenv()
	os.Setenv("NIFTY_CLOUD_SECRET_ACCESS_KEY", "secret")
	os.Setenv("NIFTY_CLOUD_ACCESS_KEY_ID", "access")
	auth, err := niftycloud.GetAuth("", "")
	c.Assert(err, IsNil)
	c.Assert(auth, Equals, niftycloud.Auth{SecretKey: "secret", AccessKey: "access"})
}
Exemplo n.º 2
0
func (s *S) TestGetAuthStatic(c *C) {
	auth, err := niftycloud.GetAuth("access", "secret")
	c.Assert(err, IsNil)
	c.Assert(auth, Equals, niftycloud.Auth{SecretKey: "secret", AccessKey: "access"})
}