/
storageattachment.go
47 lines (36 loc) · 1 KB
/
storageattachment.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package testing
import (
"github.com/juju/names"
"github.com/juju/juju/storage"
)
// StorageAttachment holds the data for the test double.
type StorageAttachment struct {
Tag names.StorageTag
Kind storage.StorageKind
Location string
}
// ContextStorageAttachment is a test double for jujuc.ContextStorageAttachment.
type ContextStorageAttachment struct {
contextBase
info *StorageAttachment
}
// Tag implements jujuc.StorageAttachement.
func (c *ContextStorageAttachment) Tag() names.StorageTag {
c.stub.AddCall("Tag")
c.stub.NextErr()
return c.info.Tag
}
// Kind implements jujuc.StorageAttachement.
func (c *ContextStorageAttachment) Kind() storage.StorageKind {
c.stub.AddCall("Kind")
c.stub.NextErr()
return c.info.Kind
}
// Location implements jujuc.StorageAttachement.
func (c *ContextStorageAttachment) Location() string {
c.stub.AddCall("Location")
c.stub.NextErr()
return c.info.Location
}