(c *check.C)
| 347 | } |
| 348 | |
| 349 | func (s *S) TestGetTokenNoExpiration(c *check.C) { |
| 350 | ctx := context.TODO() |
| 351 | tokensCollection, err := storagev2.TokensCollection() |
| 352 | c.Assert(err, check.IsNil) |
| 353 | |
| 354 | t := Token{ |
| 355 | Token: "tsuru-healer", |
| 356 | Creation: time.Now(), |
| 357 | Expires: 0, |
| 358 | } |
| 359 | defer tokensCollection.DeleteOne(ctx, mongoBSON.M{"token": t.Token}) |
| 360 | t.Creation = time.Now().Add(-24 * time.Hour) |
| 361 | _, err = tokensCollection.InsertOne(ctx, t) |
| 362 | c.Assert(err, check.IsNil) |
| 363 | |
| 364 | t2, err := getToken(ctx, t.Token) |
| 365 | c.Assert(err, check.IsNil) |
| 366 | c.Assert(t2.GetValue(), check.DeepEquals, t.GetValue()) |
| 367 | } |
| 368 | |
| 369 | func (s *S) TestDeleteToken(c *check.C) { |
| 370 | ctx := context.TODO() |
nothing calls this directly
no test coverage detected