github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/worker/uniter/runner/jujuc/jujuctesting/storageattachment.go (about)

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