diff options
author | Stephen Solka <solka@hey.com> | 2020-07-19 05:53:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-19 12:53:40 +0300 |
commit | 54513452a1134de670467e5a8d5cebd768b3c7e4 (patch) | |
tree | 48e39d2e52daa88cf93431dd6b0642e482a5e018 /integrations | |
parent | b609a25014cf732ec444c132dc9fb892818281dc (diff) | |
download | gitea-54513452a1134de670467e5a8d5cebd768b3c7e4.tar.gz gitea-54513452a1134de670467e5a8d5cebd768b3c7e4.zip |
prefer NoError/Error over Nil/NotNil (#12271)
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/repofiles_delete_test.go | 4 | ||||
-rw-r--r-- | integrations/repofiles_update_test.go | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/integrations/repofiles_delete_test.go b/integrations/repofiles_delete_test.go index 754f64023f..1fa316c41e 100644 --- a/integrations/repofiles_delete_test.go +++ b/integrations/repofiles_delete_test.go @@ -80,7 +80,7 @@ func testDeleteRepoFile(t *testing.T, u *url.URL) { t.Run("Delete README.md file", func(t *testing.T) { fileResponse, err := repofiles.DeleteRepoFile(repo, doer, opts) - assert.Nil(t, err) + assert.NoError(t, err) expectedFileResponse := getExpectedDeleteFileResponse(u) assert.NotNil(t, fileResponse) assert.Nil(t, fileResponse.Content) @@ -122,7 +122,7 @@ func testDeleteRepoFileWithoutBranchNames(t *testing.T, u *url.URL) { t.Run("Delete README.md without Branch Name", func(t *testing.T) { fileResponse, err := repofiles.DeleteRepoFile(repo, doer, opts) - assert.Nil(t, err) + assert.NoError(t, err) expectedFileResponse := getExpectedDeleteFileResponse(u) assert.NotNil(t, fileResponse) assert.Nil(t, fileResponse.Content) diff --git a/integrations/repofiles_update_test.go b/integrations/repofiles_update_test.go index c422483bf8..9e99b36ae4 100644 --- a/integrations/repofiles_update_test.go +++ b/integrations/repofiles_update_test.go @@ -201,7 +201,7 @@ func TestCreateOrUpdateRepoFileForCreate(t *testing.T) { fileResponse, err := repofiles.CreateOrUpdateRepoFile(repo, doer, opts) // asserts - assert.Nil(t, err) + assert.NoError(t, err) gitRepo, _ := git.OpenRepository(repo.RepoPath()) defer gitRepo.Close() @@ -237,7 +237,7 @@ func TestCreateOrUpdateRepoFileForUpdate(t *testing.T) { fileResponse, err := repofiles.CreateOrUpdateRepoFile(repo, doer, opts) // asserts - assert.Nil(t, err) + assert.NoError(t, err) gitRepo, _ := git.OpenRepository(repo.RepoPath()) defer gitRepo.Close() @@ -272,7 +272,7 @@ func TestCreateOrUpdateRepoFileForUpdateWithFileMove(t *testing.T) { fileResponse, err := repofiles.CreateOrUpdateRepoFile(repo, doer, opts) // asserts - assert.Nil(t, err) + assert.NoError(t, err) gitRepo, _ := git.OpenRepository(repo.RepoPath()) defer gitRepo.Close() @@ -287,7 +287,7 @@ func TestCreateOrUpdateRepoFileForUpdateWithFileMove(t *testing.T) { t.Fatalf("expected git.ErrNotExist, got:%v", err) } toEntry, err := commit.GetTreeEntryByPath(opts.TreePath) - assert.Nil(t, err) + assert.NoError(t, err) assert.Nil(t, fromEntry) // Should no longer exist here assert.NotNil(t, toEntry) // Should exist here // assert SHA has remained the same but paths use the new file name @@ -322,7 +322,7 @@ func TestCreateOrUpdateRepoFileWithoutBranchNames(t *testing.T) { fileResponse, err := repofiles.CreateOrUpdateRepoFile(repo, doer, opts) // asserts - assert.Nil(t, err) + assert.NoError(t, err) gitRepo, _ := git.OpenRepository(repo.RepoPath()) defer gitRepo.Close() |