github.com/Pankov404/juju@v0.0.0-20150703034450-be266991dceb/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  	NewServiceManager = newServiceManager
    15  )
    16  
    17  func PatchMgrConnect(patcher patcher, stub *testing.Stub) *StubMgr {
    18  	conn := &StubMgr{Stub: stub}
    19  	patcher.PatchValue(&newConn, func() (mgrInterface, error) { return conn, nil })
    20  	return conn
    21  }
    22  
    23  func PatchGetPassword(patcher patcher, stub *testing.Stub) *StubGetPassword {
    24  	p := &StubGetPassword{Stub: stub}
    25  	patcher.PatchValue(&getPassword, p.GetPassword)
    26  	return p
    27  }