Code style: All uppercase acronyms URL, ISRC, ID, HTTP

This commit is contained in:
Philipp Wolfer 2025-04-29 13:23:41 +02:00
parent 39b31fc664
commit d51c97c648
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
26 changed files with 137 additions and 137 deletions

View file

@ -32,19 +32,19 @@ import (
)
func TestNewClient(t *testing.T) {
serverUrl := "https://maloja.example.com"
serverURL := "https://maloja.example.com"
token := "foobar123"
client := maloja.NewClient(serverUrl, token)
assert.Equal(t, serverUrl, client.HttpClient.BaseURL)
client := maloja.NewClient(serverURL, token)
assert.Equal(t, serverURL, client.HTTPClient.BaseURL)
}
func TestGetScrobbles(t *testing.T) {
defer httpmock.DeactivateAndReset()
serverUrl := "https://maloja.example.com"
serverURL := "https://maloja.example.com"
token := "thetoken"
client := maloja.NewClient(serverUrl, token)
setupHttpMock(t, client.HttpClient.GetClient(),
client := maloja.NewClient(serverURL, token)
setupHTTPMock(t, client.HTTPClient.GetClient(),
"https://maloja.example.com/apis/mlj_1/scrobbles",
"testdata/scrobbles.json")
@ -60,7 +60,7 @@ func TestGetScrobbles(t *testing.T) {
func TestNewScrobble(t *testing.T) {
server := "https://maloja.example.com"
client := maloja.NewClient(server, "thetoken")
httpmock.ActivateNonDefault(client.HttpClient.GetClient())
httpmock.ActivateNonDefault(client.HTTPClient.GetClient())
responder, err := httpmock.NewJsonResponder(200, httpmock.File("testdata/newscrobble-result.json"))
if err != nil {
@ -80,7 +80,7 @@ func TestNewScrobble(t *testing.T) {
assert.Equal(t, "success", result.Status)
}
func setupHttpMock(t *testing.T, client *http.Client, url string, testDataPath string) {
func setupHTTPMock(t *testing.T, client *http.Client, url string, testDataPath string) {
httpmock.ActivateNonDefault(client)
responder, err := httpmock.NewJsonResponder(200, httpmock.File(testDataPath))