~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/apiserver/common/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 2014 Canonical Ltd.
 
2
// Licensed under the AGPLv3, see LICENCE file for details.
 
3
 
 
4
package common
 
5
 
 
6
import "github.com/juju/juju/apiserver/facade"
 
7
 
 
8
var (
 
9
        MachineJobFromParams    = machineJobFromParams
 
10
        ValidateNewFacade       = validateNewFacade
 
11
        WrapNewFacade           = wrapNewFacade
 
12
        EnvtoolsFindTools       = &envtoolsFindTools
 
13
        SendMetrics             = &sendMetrics
 
14
        MockableDestroyMachines = destroyMachines
 
15
)
 
16
 
 
17
type Patcher interface {
 
18
        PatchValue(dest, value interface{})
 
19
}
 
20
 
 
21
// SanitizeFacades patches Facades so that for the lifetime of the test we get
 
22
// a clean slate to work from, and will not accidentally overrite/mutate the
 
23
// real facade registry.
 
24
func SanitizeFacades(patcher Patcher) {
 
25
        emptyFacades := &facade.Registry{}
 
26
        patcher.PatchValue(&Facades, emptyFacades)
 
27
}