]> source.dussan.org Git - gitea.git/commitdiff
integrations: fix dropped errors in TestCreateOrUpdateRepoFileForUpdateWithFileMove...
authorLars Lehtonen <lars.lehtonen@gmail.com>
Sat, 16 Nov 2019 18:21:39 +0000 (10:21 -0800)
committerzeripath <art27@cantab.net>
Sat, 16 Nov 2019 18:21:39 +0000 (18:21 +0000)
integrations: fix dropped error in lfsCommitAndPushTest()

integrations/git_test.go
integrations/repofiles_update_test.go

index dbcc26522765f50e5c6b4ed11709c59903e954fe..c0e1d7d2841abae2a561b9e2442f68d4282d8a1c 100644 (file)
@@ -162,6 +162,7 @@ func lfsCommitAndPushTest(t *testing.T, dstPath string) (littleLFS, bigLFS strin
                        },
                        Message: fmt.Sprintf("Testing commit @ %v", time.Now()),
                })
+               assert.NoError(t, err)
                git.GlobalCommandArgs = oldGlobals
 
                littleLFS, bigLFS = commitAndPushTest(t, dstPath, prefix)
index 35cb5e8b0cb1875c353a9b1b8a1e3536954173cd..a7beec49553b35e84744ed06c7b5a5d605b5eba0 100644 (file)
@@ -277,7 +277,14 @@ func TestCreateOrUpdateRepoFileForUpdateWithFileMove(t *testing.T) {
                expectedFileResponse := getExpectedFileResponseForRepofilesUpdate(commit.ID.String(), opts.TreePath)
                // assert that the old file no longer exists in the last commit of the branch
                fromEntry, err := commit.GetTreeEntryByPath(opts.FromTreePath)
+               switch err.(type) {
+               case git.ErrNotExist:
+                       // correct, continue
+               default:
+                       t.Fatalf("expected git.ErrNotExist, got:%v", err)
+               }
                toEntry, err := commit.GetTreeEntryByPath(opts.TreePath)
+               assert.Nil(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