Пример #1
0
// useTestImageData causes the given content to be served when published metadata is requested.
func useTestImageData(c *gc.C, files map[string]string) {
	if files != nil {
		sstesting.SetRoundTripperFiles(sstesting.AddSignedFiles(c, files), nil)
	} else {
		sstesting.SetRoundTripperFiles(nil, nil)
	}
}
Пример #2
0
// Set Metadata requests to be served by the filecontent supplied.
func UseExternalTestImageMetadata(c *gc.C, creds *auth.Credentials) {
	metadata := parseIndexData(creds)
	files := map[string]string{
		"/streams/v1/index.json":                            metadata.String(),
		"/streams/v1/com.ubuntu.cloud:released:joyent.json": imagesData,
	}
	sstesting.SetRoundTripperFiles(sstesting.AddSignedFiles(c, files), nil)
}