diff options
Diffstat (limited to 'repository_test.go')
-rw-r--r-- | repository_test.go | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/repository_test.go b/repository_test.go index 7a480f1..421160d 100644 --- a/repository_test.go +++ b/repository_test.go @@ -2,6 +2,7 @@ package git import ( . "gopkg.in/check.v1" + "gopkg.in/src-d/go-git.v2/clients/http" "gopkg.in/src-d/go-git.v2/core" ) @@ -9,8 +10,21 @@ type SuiteRepository struct{} var _ = Suite(&SuiteRepository{}) +func (s *SuiteRepository) TestNewRepository(c *C) { + r, err := NewRepository(RepositoryFixture, nil) + c.Assert(err, IsNil) + c.Assert(r.Remotes["origin"].Auth, IsNil) +} + +func (s *SuiteRepository) TestNewRepositoryWithAuth(c *C) { + auth := &http.BasicAuth{} + r, err := NewRepository(RepositoryFixture, auth) + c.Assert(err, IsNil) + c.Assert(r.Remotes["origin"].Auth, Equals, auth) +} + func (s *SuiteRepository) TestPull(c *C) { - r, err := NewRepository(RepositoryFixture) + r, err := NewRepository(RepositoryFixture, nil) r.Remotes["origin"].upSrv = &MockGitUploadPackService{} c.Assert(err, IsNil) @@ -18,7 +32,7 @@ func (s *SuiteRepository) TestPull(c *C) { } func (s *SuiteRepository) TestCommit(c *C) { - r, err := NewRepository(RepositoryFixture) + r, err := NewRepository(RepositoryFixture, nil) r.Remotes["origin"].upSrv = &MockGitUploadPackService{} c.Assert(err, IsNil) @@ -34,7 +48,7 @@ func (s *SuiteRepository) TestCommit(c *C) { } func (s *SuiteRepository) TestCommits(c *C) { - r, err := NewRepository(RepositoryFixture) + r, err := NewRepository(RepositoryFixture, nil) r.Remotes["origin"].upSrv = &MockGitUploadPackService{} c.Assert(err, IsNil) |