github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/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  var (
    14  	ResetJujudPassword        = resetJujudPassword
    15  	EnsureJujudPasswordHelper = ensureJujudPasswordHelper
    16  )
    17  
    18  func PatchMgrConnect(patcher patcher, stub *testing.Stub) *StubMgr {
    19  	conn := &StubMgr{Stub: stub}
    20  	patcher.PatchValue(&newManager, func() (windowsManager, error) { return conn, nil })
    21  	return conn
    22  }
    23  
    24  func PatchGetPassword(patcher patcher, stub *testing.Stub) *StubGetPassword {
    25  	p := &StubGetPassword{Stub: stub}
    26  	patcher.PatchValue(&getPassword, p.GetPassword)
    27  	return p
    28  }