Browse Source

Fixed mistake

Piotr Czajkowski 3 years ago
parent
commit
4207991958
2 changed files with 3 additions and 3 deletions
  1. 1 1
      app_test.go
  2. 2 2
      tm.go

+ 1 - 1
app_test.go

@@ -83,7 +83,7 @@ func TestLoginBadURL(t *testing.T) {
 }
 
 func TestLoginWrongStatus(t *testing.T) {
-	server := fakeServer(http.StatusBadRequest, "")
+	server := fakeServer(http.StatusUnauthorized, "")
 	defer server.Close()
 
 	var app Application

+ 2 - 2
tm.go

@@ -32,7 +32,7 @@ func (app *Application) getTMs(language string) []TM {
 	defer resp.Body.Close()
 
 	var results []TM
-	if resp.StatusCode == http.StatusBadRequest {
+	if resp.StatusCode == http.StatusUnauthorized {
 		time.Sleep(app.Delay)
 
 		status, err := app.login()
@@ -46,7 +46,7 @@ func (app *Application) getTMs(language string) []TM {
 
 	err := jsonDecoder(resp.Body, &results)
 	if err != nil {
-		log.Printf("Error decoding results: %s", err)
+		log.Printf("Error decoding TM results: %s", err)
 	}
 
 	return results