Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
all: adapt changes in tsuru test packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Souza committed Feb 5, 2015
1 parent c9d424b commit 0c25d24
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
16 changes: 8 additions & 8 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/utils_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014 gandalf authors. All rights reserved.
// Copyright 2015 gandalf authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

Expand All @@ -13,7 +13,7 @@ import (
"github.com/tsuru/gandalf/db"
"github.com/tsuru/gandalf/fs"
"github.com/tsuru/gandalf/user"
testingfs "github.com/tsuru/tsuru/fs/testing"
"github.com/tsuru/tsuru/fs/fstest"
"gopkg.in/mgo.v2/bson"
"launchpad.net/gocheck"
)
Expand All @@ -22,7 +22,7 @@ func Test(t *testing.T) { gocheck.TestingT(t) }

type S struct {
tmpdir string
rfs *testingfs.RecordingFs
rfs *fstest.RecordingFs
router *pat.Router
}

Expand All @@ -39,7 +39,7 @@ func (s *S) SetUpSuite(c *gocheck.C) {
}

func (s *S) SetUpTest(c *gocheck.C) {
s.rfs = &testingfs.RecordingFs{}
s.rfs = &fstest.RecordingFs{}
fs.Fsystem = s.rfs
bareTemplate, _ := config.GetString("git:bare:template")
fs.Fsystem.MkdirAll(bareTemplate+"/hooks", 0755)
Expand Down
4 changes: 2 additions & 2 deletions testing/server.go → gandalftest/server.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2013 gandalf authors. All rights reserved.
// Copyright 2015 gandalf authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package testing
package gandalftest

import (
"io/ioutil"
Expand Down
4 changes: 2 additions & 2 deletions testing/server_test.go → gandalftest/server_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2014 gandalf authors. All rights reserved.
// Copyright 2015 gandalf authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package testing
package gandalftest

import (
"net/http"
Expand Down
10 changes: 5 additions & 5 deletions hook/hook_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014 gandalf authors. All rights reserved.
// Copyright 2015 gandalf authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

Expand All @@ -13,15 +13,15 @@ import (
"github.com/tsuru/config"
"github.com/tsuru/gandalf/db"
"github.com/tsuru/gandalf/fs"
testingfs "github.com/tsuru/tsuru/fs/testing"
"github.com/tsuru/tsuru/fs/fstest"
"launchpad.net/gocheck"
)

func Test(t *testing.T) { gocheck.TestingT(t) }

type S struct {
tmpdir string
rfs *testingfs.RecordingFs
rfs *fstest.RecordingFs
}

var _ = gocheck.Suite(&S{})
Expand All @@ -36,7 +36,7 @@ func (s *S) SetUpSuite(c *gocheck.C) {
}

func (s *S) SetUpTest(c *gocheck.C) {
s.rfs = &testingfs.RecordingFs{}
s.rfs = &fstest.RecordingFs{}
fs.Fsystem = s.rfs
bareTemplate, _ := config.GetString("git:bare:template")
fs.Fsystem.MkdirAll(bareTemplate+"/hooks", 0755)
Expand Down Expand Up @@ -77,7 +77,7 @@ func (s *S) TestCanAddNewHook(c *gocheck.C) {
}

func (s *S) TestCanAddNewHookInOldRepository(c *gocheck.C) {
s.rfs = &testingfs.RecordingFs{}
s.rfs = &fstest.RecordingFs{}
fs.Fsystem = s.rfs
bareTemplate, _ := config.GetString("git:bare:template")
err := fs.Fsystem.RemoveAll(bareTemplate + "/hooks")
Expand Down
10 changes: 5 additions & 5 deletions repository/git_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014 gandalf authors. All rights reserved.
// Copyright 2015 gandalf authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

Expand All @@ -11,7 +11,7 @@ import (
"github.com/tsuru/commandmocker"
"github.com/tsuru/config"
"github.com/tsuru/gandalf/fs"
"github.com/tsuru/tsuru/fs/testing"
"github.com/tsuru/tsuru/fs/fstest"
"launchpad.net/gocheck"
)

Expand Down Expand Up @@ -80,7 +80,7 @@ func (s *S) TestNewBareShouldNotPassTemplateOptionWhenItsNotSetInConfig(c *goche
}

func (s *S) TestRemoveBareShouldRemoveBareDirFromFileSystem(c *gocheck.C) {
rfs := &testing.RecordingFs{FileContent: "foo"}
rfs := &fstest.RecordingFs{FileContent: "foo"}
fs.Fsystem = rfs
defer func() { fs.Fsystem = nil }()
err := removeBare("myBare")
Expand All @@ -90,8 +90,8 @@ func (s *S) TestRemoveBareShouldRemoveBareDirFromFileSystem(c *gocheck.C) {
}

func (s *S) TestRemoveBareShouldReturnDescriptiveErrorWhenRemovalFails(c *gocheck.C) {
rfs := &testing.RecordingFs{FileContent: "foo"}
fs.Fsystem = &testing.FileNotFoundFs{RecordingFs: *rfs}
rfs := &fstest.RecordingFs{FileContent: "foo"}
fs.Fsystem = &fstest.FileNotFoundFs{RecordingFs: *rfs}
defer func() { fs.Fsystem = nil }()
err := removeBare("fooo")
c.Assert(err, gocheck.ErrorMatches, "^Could not remove git bare repository: .*")
Expand Down
12 changes: 6 additions & 6 deletions repository/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/tsuru/gandalf/db"
"github.com/tsuru/gandalf/fs"
"github.com/tsuru/gandalf/multipartzip"
fstesting "github.com/tsuru/tsuru/fs/testing"
"github.com/tsuru/tsuru/fs/fstest"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"launchpad.net/gocheck"
Expand Down Expand Up @@ -226,7 +226,7 @@ func (s *S) TestNewShouldCreateNamesakeRepositories(c *gocheck.C) {
}

func (s *S) TestNewPublicRepository(c *gocheck.C) {
rfs := &fstesting.RecordingFs{FileContent: "foo"}
rfs := &fstest.RecordingFs{FileContent: "foo"}
fs.Fsystem = rfs
defer func() { fs.Fsystem = nil }()
tmpdir, err := commandmocker.Add("git", "$*")
Expand Down Expand Up @@ -352,7 +352,7 @@ func (s *S) TestRemoveShouldRemoveBareRepositoryFromFileSystem(c *gocheck.C) {
tmpdir, err := commandmocker.Add("git", "$*")
c.Assert(err, gocheck.IsNil)
defer commandmocker.Remove(tmpdir)
rfs := &fstesting.RecordingFs{FileContent: "foo"}
rfs := &fstest.RecordingFs{FileContent: "foo"}
fs.Fsystem = rfs
defer func() { fs.Fsystem = nil }()
r, err := New("myRepo", []string{"pumpkin"}, []string{""}, false)
Expand All @@ -367,7 +367,7 @@ func (s *S) TestRemoveShouldRemoveRepositoryFromDatabase(c *gocheck.C) {
tmpdir, err := commandmocker.Add("git", "$*")
c.Assert(err, gocheck.IsNil)
defer commandmocker.Remove(tmpdir)
rfs := &fstesting.RecordingFs{FileContent: "foo"}
rfs := &fstest.RecordingFs{FileContent: "foo"}
fs.Fsystem = rfs
defer func() { fs.Fsystem = nil }()
r, err := New("myRepo", []string{"pumpkin"}, []string{""}, false)
Expand All @@ -382,7 +382,7 @@ func (s *S) TestRemoveShouldRemoveRepositoryFromDatabase(c *gocheck.C) {
}

func (s *S) TestRemoveShouldReturnMeaningfulErrorWhenRepositoryDoesNotExistInDatabase(c *gocheck.C) {
rfs := &fstesting.RecordingFs{FileContent: "foo"}
rfs := &fstest.RecordingFs{FileContent: "foo"}
fs.Fsystem = rfs
defer func() { fs.Fsystem = nil }()
r := &Repository{Name: "fooBar"}
Expand Down Expand Up @@ -421,7 +421,7 @@ func (s *S) TestUpdateWithRenaming(c *gocheck.C) {
c.Assert(err, gocheck.IsNil)
defer conn.Close()
defer conn.Repository().RemoveId(r.Name)
rfs := &fstesting.RecordingFs{}
rfs := &fstest.RecordingFs{}
fs.Fsystem = rfs
defer func() { fs.Fsystem = nil }()
expected := Repository{
Expand Down
8 changes: 4 additions & 4 deletions user/user_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014 gandalf authors. All rights reserved.
// Copyright 2015 gandalf authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

Expand All @@ -14,15 +14,15 @@ import (
"github.com/tsuru/gandalf/db"
"github.com/tsuru/gandalf/fs"
"github.com/tsuru/gandalf/repository"
fstesting "github.com/tsuru/tsuru/fs/testing"
"github.com/tsuru/tsuru/fs/fstest"
"gopkg.in/mgo.v2/bson"
"launchpad.net/gocheck"
)

func Test(t *testing.T) { gocheck.TestingT(t) }

type S struct {
rfs *fstesting.RecordingFs
rfs *fstest.RecordingFs
}

var _ = gocheck.Suite(&S{})
Expand All @@ -44,7 +44,7 @@ func (s *S) SetUpSuite(c *gocheck.C) {
}

func (s *S) SetUpTest(c *gocheck.C) {
s.rfs = &fstesting.RecordingFs{}
s.rfs = &fstest.RecordingFs{}
fs.Fsystem = s.rfs
}

Expand Down

0 comments on commit 0c25d24

Please sign in to comment.