Code review comment for lp:~wallyworld/juju-core/bzr-test-panic

Revision history for this message
Ian Booth (wallyworld) wrote :

Reviewers: mp+220394_code.launchpad.net,

Message:
Please take a look.

Description:
Fix store tests which use bzr

The various test suites in store should
embed FakeHomeSuite not BaseSuite

https://code.launchpad.net/~wallyworld/juju-core/bzr-test-panic/+merge/220394

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/100590048/

Affected files (+13, -11 lines):
   A [revision details]
   M charm/repo_test.go
   M store/store_test.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20140521080953-4mnjcoft8cg7dzht
+New revision: <email address hidden>

Index: charm/repo_test.go
=== modified file 'charm/repo_test.go'
--- charm/repo_test.go 2014-05-20 04:27:02 +0000
+++ charm/repo_test.go 2014-05-21 08:44:16 +0000
@@ -18,7 +18,7 @@
  )

  type StoreSuite struct {
- testing.BaseSuite
+ testing.FakeHomeSuite
   server *charmtesting.MockStore
   store *charm.CharmStore
  }
@@ -26,7 +26,7 @@
  var _ = gc.Suite(&StoreSuite{})

  func (s *StoreSuite) SetUpSuite(c *gc.C) {
- s.BaseSuite.SetUpSuite(c)
+ s.FakeHomeSuite.SetUpSuite(c)
   s.server = charmtesting.NewMockStore(c, map[string]int{
    "cs:series/good": 23,
    "cs:series/unwise": 23,
@@ -36,7 +36,7 @@
  }

  func (s *StoreSuite) SetUpTest(c *gc.C) {
- s.BaseSuite.SetUpTest(c)
+ s.FakeHomeSuite.SetUpTest(c)
   s.PatchValue(&charm.CacheDir, c.MkDir())
   s.store = charm.NewStore(s.server.Address())
   s.server.Downloads = nil
@@ -49,7 +49,7 @@

  func (s *StoreSuite) TearDownSuite(c *gc.C) {
   s.server.Close()
- s.BaseSuite.TearDownSuite(c)
+ s.FakeHomeSuite.TearDownSuite(c)
  }

  func (s *StoreSuite) TestMissing(c *gc.C) {
@@ -374,7 +374,7 @@
  }

  type LocalRepoSuite struct {
- testing.BaseSuite
+ testing.FakeHomeSuite
   repo *charm.LocalRepository
   seriesPath string
  }
@@ -382,7 +382,7 @@
  var _ = gc.Suite(&LocalRepoSuite{})

  func (s *LocalRepoSuite) SetUpTest(c *gc.C) {
- s.BaseSuite.SetUpTest(c)
+ s.FakeHomeSuite.SetUpTest(c)
   root := c.MkDir()
   s.repo = &charm.LocalRepository{Path: root}
   s.seriesPath = filepath.Join(root, "quantal")

Index: store/store_test.go
=== modified file 'store/store_test.go'
--- store/store_test.go 2014-05-20 04:27:02 +0000
+++ store/store_test.go 2014-05-21 08:44:16 +0000
@@ -32,7 +32,7 @@
  type StoreSuite struct {
   testing.MgoSuite
   testing.HTTPSuite
- testing.BaseSuite
+ testing.FakeHomeSuite
   store *store.Store
  }

@@ -41,7 +41,7 @@
  type TrivialSuite struct{}

  func (s *StoreSuite) SetUpSuite(c *gc.C) {
- s.BaseSuite.SetUpSuite(c)
+ s.FakeHomeSuite.SetUpSuite(c)
   s.MgoSuite.SetUpSuite(c)
   s.HTTPSuite.SetUpSuite(c)
   if os.Getenv("JUJU_NOTEST_MONGOJS") == "1" || testing.MgoServer.WithoutV8
{
@@ -53,11 +53,11 @@
  func (s *StoreSuite) TearDownSuite(c *gc.C) {
   s.HTTPSuite.TearDownSuite(c)
   s.MgoSuite.TearDownSuite(c)
- s.BaseSuite.TearDownSuite(c)
+ s.FakeHomeSuite.TearDownSuite(c)
  }

  func (s *StoreSuite) SetUpTest(c *gc.C) {
- s.BaseSuite.SetUpTest(c)
+ s.FakeHomeSuite.SetUpTest(c)
   s.MgoSuite.SetUpTest(c)
   s.HTTPSuite.SetUpTest(c)
   var err error
@@ -71,7 +71,7 @@
   }
   s.HTTPSuite.TearDownTest(c)
   s.MgoSuite.TearDownTest(c)
- s.BaseSuite.TearDownTest(c)
+ s.FakeHomeSuite.TearDownTest(c)
  }

  // FakeCharmDir is a charm that implements the interface that the

« Back to merge proposal