github.com/juju/juju@v0.0.0-20240327075706-a90865de2538/api/client/resources/package_test.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package resources
     5  
     6  import (
     7  	"testing"
     8  
     9  	gc "gopkg.in/check.v1"
    10  
    11  	"github.com/juju/juju/api/base"
    12  	"github.com/juju/juju/api/http"
    13  )
    14  
    15  func Test(t *testing.T) {
    16  	gc.TestingT(t)
    17  }
    18  
    19  func NewClientForTest(caller base.FacadeCaller, httpClient http.HTTPDoer) *Client {
    20  	return &Client{
    21  		ClientFacade: noopCloser{caller},
    22  		facade:       caller,
    23  		httpClient:   httpClient,
    24  	}
    25  }
    26  
    27  type noopCloser struct {
    28  	base.FacadeCaller
    29  }
    30  
    31  func (noopCloser) Close() error {
    32  	return nil
    33  }
    34  
    35  func NewClientFromCaller(caller base.FacadeCaller) *Client {
    36  	return &Client{
    37  		facade: caller,
    38  	}
    39  }