mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-25 19:26:09 +01:00
integrations: fix dropped errors in TestCreateOrUpdateRepoFileForUpdateWithFileMove() (#9040)
integrations: fix dropped error in lfsCommitAndPushTest()
This commit is contained in:
parent
f4bdcd6e2b
commit
3dfe9190b0
|
@ -162,6 +162,7 @@ func lfsCommitAndPushTest(t *testing.T, dstPath string) (littleLFS, bigLFS strin
|
||||||
},
|
},
|
||||||
Message: fmt.Sprintf("Testing commit @ %v", time.Now()),
|
Message: fmt.Sprintf("Testing commit @ %v", time.Now()),
|
||||||
})
|
})
|
||||||
|
assert.NoError(t, err)
|
||||||
git.GlobalCommandArgs = oldGlobals
|
git.GlobalCommandArgs = oldGlobals
|
||||||
|
|
||||||
littleLFS, bigLFS = commitAndPushTest(t, dstPath, prefix)
|
littleLFS, bigLFS = commitAndPushTest(t, dstPath, prefix)
|
||||||
|
|
|
@ -277,7 +277,14 @@ func TestCreateOrUpdateRepoFileForUpdateWithFileMove(t *testing.T) {
|
||||||
expectedFileResponse := getExpectedFileResponseForRepofilesUpdate(commit.ID.String(), opts.TreePath)
|
expectedFileResponse := getExpectedFileResponseForRepofilesUpdate(commit.ID.String(), opts.TreePath)
|
||||||
// assert that the old file no longer exists in the last commit of the branch
|
// assert that the old file no longer exists in the last commit of the branch
|
||||||
fromEntry, err := commit.GetTreeEntryByPath(opts.FromTreePath)
|
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)
|
toEntry, err := commit.GetTreeEntryByPath(opts.TreePath)
|
||||||
|
assert.Nil(t, err)
|
||||||
assert.Nil(t, fromEntry) // Should no longer exist here
|
assert.Nil(t, fromEntry) // Should no longer exist here
|
||||||
assert.NotNil(t, toEntry) // Should exist here
|
assert.NotNil(t, toEntry) // Should exist here
|
||||||
// assert SHA has remained the same but paths use the new file name
|
// assert SHA has remained the same but paths use the new file name
|
||||||
|
|
Loading…
Reference in a new issue