mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-18 12:25:14 +00:00
fix failing gitlab and cc tests
This commit is contained in:
parent
6c81c9cb03
commit
5d586582c8
2 changed files with 6 additions and 4 deletions
|
@ -2,6 +2,7 @@ package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/franela/goblin"
|
"github.com/franela/goblin"
|
||||||
)
|
)
|
||||||
|
@ -12,14 +13,15 @@ func TestCC(t *testing.T) {
|
||||||
g.Describe("CC", func() {
|
g.Describe("CC", func() {
|
||||||
|
|
||||||
g.It("Should create a project", func() {
|
g.It("Should create a project", func() {
|
||||||
|
now := time.Now().Unix()
|
||||||
|
now_fmt := time.Unix(now, 0).Format(time.RFC3339)
|
||||||
r := &Repo{
|
r := &Repo{
|
||||||
FullName: "foo/bar",
|
FullName: "foo/bar",
|
||||||
}
|
}
|
||||||
b := &Build{
|
b := &Build{
|
||||||
Status: StatusSuccess,
|
Status: StatusSuccess,
|
||||||
Number: 1,
|
Number: 1,
|
||||||
Started: 1442872675,
|
Started: now,
|
||||||
}
|
}
|
||||||
cc := NewCC(r, b, "http://localhost/foo/bar/1")
|
cc := NewCC(r, b, "http://localhost/foo/bar/1")
|
||||||
|
|
||||||
|
@ -27,7 +29,7 @@ func TestCC(t *testing.T) {
|
||||||
g.Assert(cc.Project.Activity).Equal("Sleeping")
|
g.Assert(cc.Project.Activity).Equal("Sleeping")
|
||||||
g.Assert(cc.Project.LastBuildStatus).Equal("Success")
|
g.Assert(cc.Project.LastBuildStatus).Equal("Success")
|
||||||
g.Assert(cc.Project.LastBuildLabel).Equal("1")
|
g.Assert(cc.Project.LastBuildLabel).Equal("1")
|
||||||
g.Assert(cc.Project.LastBuildTime).Equal("2015-09-21T14:57:55-07:00")
|
g.Assert(cc.Project.LastBuildTime).Equal(now_fmt)
|
||||||
g.Assert(cc.Project.WebURL).Equal("http://localhost/foo/bar/1")
|
g.Assert(cc.Project.WebURL).Equal("http://localhost/foo/bar/1")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ func Test_Gitlab(t *testing.T) {
|
||||||
g.Assert(err == nil).IsTrue()
|
g.Assert(err == nil).IsTrue()
|
||||||
g.Assert(_repo.Name).Equal("diaspora-client")
|
g.Assert(_repo.Name).Equal("diaspora-client")
|
||||||
g.Assert(_repo.Owner).Equal("diaspora")
|
g.Assert(_repo.Owner).Equal("diaspora")
|
||||||
g.Assert(_repo.Private).Equal(true)
|
g.Assert(_repo.IsPrivate).Equal(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
g.It("Should return error, when repo not exist", func() {
|
g.It("Should return error, when repo not exist", func() {
|
||||||
|
|
Loading…
Reference in a new issue