github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/service/windows/export_windows_test.go (about)

     1  // Copyright 2015 Cloudbase Solutions
     2  // Copyright 2015 Canonical Ltd.
     3  // Licensed under the AGPLv3, see LICENCE file for details.
     4  
     5  // +build windows
     6  
     7  package windows
     8  
     9  import (
    10  	"github.com/juju/testing"
    11  )
    12  
    13  func PatchMgrConnect(patcher patcher, stub *testing.Stub) *StubMgr {
    14  	conn := &StubMgr{Stub: stub}
    15  	patcher.PatchValue(&newManager, func() (windowsManager, error) { return conn, nil })
    16  	return conn
    17  }
    18  
    19  func PatchGetPassword(patcher patcher, stub *testing.Stub) *StubGetPassword {
    20  	p := &StubGetPassword{Stub: stub}
    21  	patcher.PatchValue(&getPassword, p.GetPassword)
    22  	return p
    23  }