瀏覽代碼

Make InvalidToken test useful again.

Chris Rhodes 9 年之前
父節點
當前提交
2cbd402bae
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      discord_test.go

+ 7 - 1
discord_test.go

@@ -86,10 +86,16 @@ func TestNew(t *testing.T) {
 
 // TestInvalidToken tests the New() function with an invalid token
 func TestInvalidToken(t *testing.T) {
-	_, err := New("asjkldhflkjasdh")
+	d, err := New("asjkldhflkjasdh")
 	if err != nil {
 		t.Fatalf("New(InvalidToken) returned error: %+v", err)
 	}
+
+	// New with just a token does not do any communication, so attempt an api call.
+	_, err = d.UserSettings()
+	if err == nil {
+		t.Errorf("New(InvalidToken), d.UserSettings returned nil error.")
+	}
 }
 
 // TestInvalidUserPass tests the New() function with an invalid Email and Pass