~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/storage/export_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2015 Canonical Ltd.
 
2
// Licensed under the AGPLv3, see LICENCE file for details.
 
3
 
 
4
package storage
 
5
 
 
6
import (
 
7
        "github.com/juju/cmd"
 
8
 
 
9
        "github.com/juju/juju/cmd/modelcmd"
 
10
        "github.com/juju/juju/jujuclient"
 
11
)
 
12
 
 
13
var (
 
14
        ConvertToVolumeInfo     = convertToVolumeInfo
 
15
        ConvertToFilesystemInfo = convertToFilesystemInfo
 
16
)
 
17
 
 
18
func NewPoolListCommandForTest(api PoolListAPI, store jujuclient.ClientStore) cmd.Command {
 
19
        cmd := &poolListCommand{newAPIFunc: func() (PoolListAPI, error) {
 
20
                return api, nil
 
21
        }}
 
22
        cmd.SetClientStore(store)
 
23
        return modelcmd.Wrap(cmd)
 
24
}
 
25
 
 
26
func NewPoolCreateCommandForTest(api PoolCreateAPI, store jujuclient.ClientStore) cmd.Command {
 
27
        cmd := &poolCreateCommand{newAPIFunc: func() (PoolCreateAPI, error) {
 
28
                return api, nil
 
29
        }}
 
30
        cmd.SetClientStore(store)
 
31
        return modelcmd.Wrap(cmd)
 
32
}
 
33
 
 
34
func NewShowCommandForTest(api StorageShowAPI, store jujuclient.ClientStore) cmd.Command {
 
35
        cmd := &showCommand{newAPIFunc: func() (StorageShowAPI, error) {
 
36
                return api, nil
 
37
        }}
 
38
        cmd.SetClientStore(store)
 
39
        return modelcmd.Wrap(cmd)
 
40
}
 
41
 
 
42
func NewListCommandForTest(api StorageListAPI, store jujuclient.ClientStore) cmd.Command {
 
43
        cmd := &listCommand{newAPIFunc: func() (StorageListAPI, error) {
 
44
                return api, nil
 
45
        }}
 
46
        cmd.SetClientStore(store)
 
47
        return modelcmd.Wrap(cmd)
 
48
}
 
49
 
 
50
func NewAddCommandForTest(api StorageAddAPI, store jujuclient.ClientStore) cmd.Command {
 
51
        cmd := &addCommand{newAPIFunc: func() (StorageAddAPI, error) {
 
52
                return api, nil
 
53
        }}
 
54
        cmd.SetClientStore(store)
 
55
        return modelcmd.Wrap(cmd)
 
56
}