Ejemplo n.º 1
0
func (s *gridfsSuite) TestNamespaceSeparation(c *gc.C) {
	anotherStor := storage.NewGridFS("another", s.Session)
	path := "/path/to/file"
	assertPut(c, anotherStor, path, "hello world")
	_, err := s.stor.Get(path)
	c.Assert(err, gc.ErrorMatches, `failed to open GridFS file "/path/to/file": not found`)
}
Ejemplo n.º 2
0
func (s *gridfsSuite) TestNamespaceSeparationRemove(c *gc.C) {
	anotherStor := storage.NewGridFS("another", s.Session)
	path := "/path/to/file"
	assertPut(c, s.stor, path, "hello world")
	assertPut(c, anotherStor, path, "hello again")
	err := s.stor.Remove(path)
	c.Assert(err, gc.IsNil)
	assertGet(c, anotherStor, "/path/to/file", "hello again")
}
Ejemplo n.º 3
0
func (s *gridfsSuite) SetUpTest(c *gc.C) {
	s.BaseSuite.SetUpTest(c)
	s.MgoSuite.SetUpTest(c)
	s.stor = storage.NewGridFS("test", s.Session)
}