示例#1
0
func (s *MongoSuite) SetUpTest(c *C) {
	s.reset()
	s.Session = juju_testing.MgoServer.MustDial()
	{
		store, err := mongo.NewMongoStore(s.Session, "affinity_store_suite", "", "")
		c.Assert(err, IsNil)
		s.StoreSuite = testing.NewStoreSuite(store)
		s.StoreTests.SetUp(c)
	}
	{
		store, err := mongo.NewMongoStore(s.Session, "affinity_rbac_suite", "", "")
		c.Assert(err, IsNil)
		s.RbacSuite = testing.NewRbacSuite(store)
		s.RbacTests.SetUp(c)
	}
}
示例#2
0
func (s *MongoAuthSuite) SetUpTest(c *C) {
	s.reset()
	s.Session = juju_testing.MgoServer.MustDial()
	c.Assert(s.setPassword(), IsNil)
	{
		store, err := mongo.NewMongoStore(s.Session, "affinity_store_suite_auth", "admin", "password")
		c.Assert(err, IsNil)
		s.StoreSuite = testing.NewStoreSuite(store)
		s.StoreTests.SetUp(c)
	}
	{
		store, err := mongo.NewMongoStore(s.Session, "affinity_rbac_suite_auth", "admin", "password")
		c.Assert(err, IsNil)
		s.RbacSuite = testing.NewRbacSuite(store)
		s.RbacTests.SetUp(c)
	}
}
示例#3
0
func (s *AffinitySuite) SetUpTest(c *C) {
	s.StoreSuite = testing.NewStoreSuite(mem.NewStore())
	s.StoreSuite.SetUp(c)
	s.RbacSuite = testing.NewRbacSuite(mem.NewStore())
	s.RbacSuite.SetUp(c)
}