You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: client_test.go
    path of file: ./repos/loginsrv/osiam
    
    the code of the file until where you have to start completion: package osiam

import (
	"fmt"
	. "github.com/stretchr/testify/assert"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"testing"
	"time"
)

func TestClient_GetTokenByPasswor
    
func TestClient_GetTokenByPasswordErrorCases(t *testing.T) {
	server := httptest.NewServer(http.HandlerFunc(osiamMockHandler))
	defer server.Close()

	// wrong credentials
	client := NewClient(server.URL, "example-client", "secret")
	authenticated, _, err := client.GetTokenByPassword("admin", "XXX")
	NoError(t, err)
	False(t, authenticated)

	// wrong url -> 404
	client = NewClient(server.URL+"/Foo", "example-client", "secret")
	_, _, err = client.GetTokenByPassword("admin", "koala")
	Error(t, err)

	// wrong client secret
	client = NewClient(server.URL, "example-client", "XXX")
	_, _, err = client.GetTokenByPassword("admin", "koala")
	Error(t, err)

	// invalid url
	client = NewClient("://", "example-client", "secret")
	_, _, err = client.GetTokenByPassword("admin", "koala")
	Error(t, err)

}