Cleanup metadata tests

This commit replaces func returns with t.Cleanup,
which makes API and tests slightly easier to maintain.

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2022-06-27 11:54:45 -07:00
parent 813780e443
commit d97b754a5b
9 changed files with 73 additions and 123 deletions

View File

@@ -28,8 +28,7 @@ import (
)
func TestLeases(t *testing.T) {
ctx, db, cancel := testEnv(t)
defer cancel()
ctx, db := testEnv(t)
lm := NewLeaseManager(NewDB(db, nil, nil))
@@ -108,8 +107,7 @@ func TestLeases(t *testing.T) {
}
func TestLeasesList(t *testing.T) {
ctx, db, cancel := testEnv(t)
defer cancel()
ctx, db := testEnv(t)
lm := NewLeaseManager(NewDB(db, nil, nil))
@@ -252,8 +250,7 @@ func TestLeasesList(t *testing.T) {
}
func TestLeaseResource(t *testing.T) {
ctx, db, cancel := testEnv(t)
defer cancel()
ctx, db := testEnv(t)
lm := NewLeaseManager(NewDB(db, nil, nil))