Ejemplo n.º 1
0
func TestOrZeroReturnsNoneOnNil(t *testing.T) {
	if v := credentials.OrZero(nil); v != credentials.None {
		t.Errorf("credentials.OrZero(nil) should've returned credentials.None, not %v!", v)
	}
}
Ejemplo n.º 2
0
// New creates a new Nexus client, using the default Client implementation.
func New(url string, c credentials.Credentials) Client {
	return &Nexus2x{
		URL:         url,
		Credentials: credentials.OrZero(c),
		HTTPClient:  &http.Client{}}
}
Ejemplo n.º 3
0
func TestOrZeroReturnsTheGivenNonNilArgument(t *testing.T) {
	c := credentials.BasicAuth("", "")
	if v := credentials.OrZero(c); v != c {
		t.Errorf("credentials.OrZero(%v) should've returned %v, not %v!", c, c, v)
	}
}