func (s *S) SetUpSuite(c *gocheck.C) { config.Set("auth:token-expire-days", 2) config.Set("auth:hash-cost", bcrypt.MinCost) config.Set("admin-team", "admin") config.Set("database:url", "127.0.0.1:27017") config.Set("database:name", "tsuru_auth_native_test") var err error s.server, err = ttesting.NewSMTPServer() c.Assert(err, gocheck.IsNil) config.Set("smtp:server", s.server.Addr()) config.Set("smtp:user", "root") config.Set("smtp:password", "123456") }
func (s *S) SetUpSuite(c *gocheck.C) { config.Set("auth:token-expire-days", 2) config.Set("auth:hash-cost", bcrypt.MinCost) config.Set("admin-team", "admin") config.Set("database:url", "127.0.0.1:27017") config.Set("database:name", "tsuru_auth_test") s.conn, _ = db.Conn() s.user = &User{Email: "*****@*****.**", Password: "******"} s.user.Create() s.hashed = s.user.Password team := &Team{Name: "cobrateam", Users: []string{s.user.Email}} err := s.conn.Teams().Insert(team) c.Assert(err, gocheck.IsNil) s.team = team s.gitHost, _ = config.GetString("git:host") s.gitPort, _ = config.GetString("git:port") s.gitProt, _ = config.GetString("git:protocol") s.server, err = ttesting.NewSMTPServer() c.Assert(err, gocheck.IsNil) config.Set("smtp:server", s.server.Addr()) config.Set("smtp:user", "root") config.Set("smtp:password", "123456") }