Example #1
0
func (s *OpenedResourceSuite) TestInfo(c *gc.C) {
	expected, reader := newResource(c, s.stub.Stub, "spam", "some data")
	opened := internal.OpenedResource{
		Resource:   expected,
		ReadCloser: reader,
	}

	info := opened.Info()

	s.stub.CheckNoCalls(c)
	c.Check(info, jc.DeepEquals, expected)
}
Example #2
0
func (s *OpenedResourceSuite) TestContent(c *gc.C) {
	info, reader := newResource(c, s.stub.Stub, "spam", "some data")
	opened := internal.OpenedResource{
		Resource:   info,
		ReadCloser: reader,
	}

	content := opened.Content()

	s.stub.CheckNoCalls(c)
	c.Check(content, jc.DeepEquals, internal.Content{
		Data:        reader,
		Size:        info.Size,
		Fingerprint: info.Fingerprint,
	})
}