Skip to content

Commit 8e9e019

Browse files
committed
add tests
1 parent a06bed4 commit 8e9e019

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

models/release_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
"code.gitea.io/git"
1111

12+
"github.com/Unknwon/com"
1213
"github.com/stretchr/testify/assert"
1314
)
1415

@@ -17,10 +18,13 @@ func TestRelease_Create(t *testing.T) {
1718

1819
user := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
1920
repo := AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository)
20-
repoPath := RepoPath(user.Name, repo.Name)
21+
22+
repoPath := repo.LocalCopyPath()
23+
assert.True(t, com.IsExist(repoPath))
2124

2225
gitRepo, err := git.OpenRepository(repoPath)
2326
assert.NoError(t, err)
27+
assert.NotNil(t, gitRepo)
2428

2529
assert.NoError(t, CreateRelease(gitRepo, &Release{
2630
RepoID: repo.ID,

0 commit comments

Comments
 (0)