From a54ac2ef79847965fe869ac6f3547f17df573246 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Mon, 20 Dec 2021 17:00:01 +0100 Subject: [PATCH] Remove FS, MEM, GAS leftover test anotations. --- node/repo/fsrepo_test.go | 3 --- node/repo/memrepo_test.go | 1 - node/repo/repo_test.go | 12 ------------ 3 files changed, 16 deletions(-) diff --git a/node/repo/fsrepo_test.go b/node/repo/fsrepo_test.go index 430e01297..381ebdcbe 100644 --- a/node/repo/fsrepo_test.go +++ b/node/repo/fsrepo_test.go @@ -13,13 +13,11 @@ func genFsRepo(t *testing.T) (*FsRepo, func()) { t.Fatal(err) } - FS_001 repo, err := NewFS(path) if err != nil { t.Fatal(err) } - FS_002 err = repo.Init(FullNode) if err != ErrRepoExists && err != nil { t.Fatal(err) @@ -32,6 +30,5 @@ func genFsRepo(t *testing.T) (*FsRepo, func()) { func TestFsBasic(t *testing.T) { repo, closer := genFsRepo(t) defer closer() - FS_003 basicTest(t, repo) } diff --git a/node/repo/memrepo_test.go b/node/repo/memrepo_test.go index 8c2ad1cbf..fdf609bac 100644 --- a/node/repo/memrepo_test.go +++ b/node/repo/memrepo_test.go @@ -7,6 +7,5 @@ import ( func TestMemBasic(t *testing.T) { repo := NewMemory(nil) - MEM_001 basicTest(t, repo) } diff --git a/node/repo/repo_test.go b/node/repo/repo_test.go index 578cd8c38..cd19f86f6 100644 --- a/node/repo/repo_test.go +++ b/node/repo/repo_test.go @@ -15,20 +15,17 @@ import ( ) func basicTest(t *testing.T, repo Repo) { - NET_001 apima, err := repo.APIEndpoint() if assert.Error(t, err) { assert.Equal(t, ErrNoAPIEndpoint, err) } assert.Nil(t, apima, "with no api endpoint, return should be nil") - MUT_001 lrepo, err := repo.Lock(FullNode) assert.NoError(t, err, "should be able to lock once") assert.NotNil(t, lrepo, "locked repo shouldn't be nil") { - MUT_002 lrepo2, err := repo.Lock(FullNode) if assert.Error(t, err) { assert.Equal(t, ErrRepoAlreadyLocked, err) @@ -36,7 +33,6 @@ func basicTest(t *testing.T, repo Repo) { assert.Nil(t, lrepo2, "with locked repo errors, nil should be returned") } - MUT_003 err = lrepo.Close() assert.NoError(t, err, "should be able to unlock") @@ -47,7 +43,6 @@ func basicTest(t *testing.T, repo Repo) { ma, err := multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/43244") assert.NoError(t, err, "creating multiaddr shouldn't error") - NET_002 err = lrepo.SetAPIEndpoint(ma) assert.NoError(t, err, "setting multiaddr shouldn't error") @@ -75,7 +70,6 @@ func basicTest(t *testing.T, repo Repo) { err = lrepo.Close() assert.NoError(t, err, "should be able to close") - NET_003 apima, err = repo.APIEndpoint() if assert.Error(t, err) { @@ -90,27 +84,22 @@ func basicTest(t *testing.T, repo Repo) { assert.NoError(t, err, "should be able to relock") assert.NotNil(t, lrepo, "locked repo shouldn't be nil") - KEYSTR_001 kstr, err := lrepo.KeyStore() assert.NoError(t, err, "should be able to get keystore") assert.NotNil(t, lrepo, "keystore shouldn't be nil") - KEYSTR_002 list, err := kstr.List() assert.NoError(t, err, "should be able to list key") assert.Empty(t, list, "there should be no keys") - KEYSTR_003 err = kstr.Put("k1", k1) assert.NoError(t, err, "should be able to put k1") - KEYSTR_004 err = kstr.Put("k1", k1) if assert.Error(t, err, "putting key under the same name should error") { assert.True(t, xerrors.Is(err, types.ErrKeyExists), "returned error is ErrKeyExists") } - KEYSTR_005 k1prim, err := kstr.Get("k1") assert.NoError(t, err, "should be able to get k1") assert.Equal(t, k1, k1prim, "returned key should be the same") @@ -128,7 +117,6 @@ func basicTest(t *testing.T, repo Repo) { assert.NoError(t, err, "should be able to list keys") assert.ElementsMatch(t, []string{"k1", "k2"}, list, "returned elements match") - KEYSTR_006 err = kstr.Delete("k2") assert.NoError(t, err, "should be able to delete key")