Этот коммит содержится в:
Chris
2017-10-30 11:57:24 -05:00
коммит произвёл GitHub
родитель 63df41b911
Коммит c5e8cb25ca
49 изменённых файлов: 96 добавлений и 184 удалений

Просмотреть файл

@@ -322,7 +322,6 @@ func getChannel(c *Context, w http.ResponseWriter, r *http.Request) {
}
w.Write([]byte(channel.ToJson()))
return
}
func getChannelUnread(c *Context, w http.ResponseWriter, r *http.Request) {
@@ -601,7 +600,6 @@ func getChannelByNameForTeamName(c *Context, w http.ResponseWriter, r *http.Requ
}
w.Write([]byte(channel.ToJson()))
return
}
func getChannelMembers(c *Context, w http.ResponseWriter, r *http.Request) {

Просмотреть файл

@@ -127,7 +127,7 @@ func TestCreateEmoji(t *testing.T) {
Name: model.NewId(),
}
_, resp = Client.CreateEmoji(emoji, make([]byte, 100, 100), "image.gif")
_, resp = Client.CreateEmoji(emoji, make([]byte, 100), "image.gif")
CheckBadRequestStatus(t, resp)
CheckErrorMessage(t, resp, "api.emoji.upload.image.app_error")
@@ -232,7 +232,7 @@ func TestDeleteEmoji(t *testing.T) {
ok, resp := Client.DeleteEmoji(newEmoji.Id)
CheckNoError(t, resp)
if ok != true {
if !ok {
t.Fatal("should return true")
} else {
_, err := Client.GetEmoji(newEmoji.Id)
@@ -247,7 +247,7 @@ func TestDeleteEmoji(t *testing.T) {
ok, resp = th.SystemAdminClient.DeleteEmoji(newEmoji.Id)
CheckNoError(t, resp)
if ok != true {
if !ok {
t.Fatal("should return true")
} else {
_, err := th.SystemAdminClient.GetEmoji(newEmoji.Id)

Просмотреть файл

@@ -151,7 +151,7 @@ func TestGetFile(t *testing.T) {
data, resp := Client.GetFile(fileId)
CheckNoError(t, resp)
if data == nil || len(data) == 0 {
if len(data) == 0 {
t.Fatal("should not be empty")
}
@@ -268,7 +268,7 @@ func TestGetFileThumbnail(t *testing.T) {
data, resp := Client.GetFileThumbnail(fileId)
CheckNoError(t, resp)
if data == nil || len(data) == 0 {
if len(data) == 0 {
t.Fatal("should not be empty")
}
@@ -395,7 +395,7 @@ func TestGetFilePreview(t *testing.T) {
data, resp := Client.GetFilePreview(fileId)
CheckNoError(t, resp)
if data == nil || len(data) == 0 {
if len(data) == 0 {
t.Fatal("should not be empty")
}

Просмотреть файл

@@ -572,7 +572,7 @@ func TestPatchPost(t *testing.T) {
rpost, resp := Client.PatchPost(post.Id, patch)
CheckNoError(t, resp)
if rpost.IsPinned != false {
if rpost.IsPinned {
t.Fatal("IsPinned did not update properly")
}
if rpost.Message != "#otherhashtag other message" {
@@ -593,7 +593,7 @@ func TestPatchPost(t *testing.T) {
if !reflect.DeepEqual(rpost.FileIds, *patch.FileIds) {
t.Fatal("FileIds did not update properly")
}
if rpost.HasReactions != false {
if rpost.HasReactions {
t.Fatal("HasReactions did not update properly")
}
@@ -642,7 +642,7 @@ func TestPinPost(t *testing.T) {
t.Fatal("should have passed")
}
if rpost, err := th.App.GetSinglePost(post.Id); err != nil && rpost.IsPinned != true {
if rpost, err := th.App.GetSinglePost(post.Id); err != nil && !rpost.IsPinned {
t.Fatal("failed to pin post")
}
@@ -677,7 +677,7 @@ func TestUnpinPost(t *testing.T) {
t.Fatal("should have passed")
}
if rpost, err := th.App.GetSinglePost(pinnedPost.Id); err != nil && rpost.IsPinned != false {
if rpost, err := th.App.GetSinglePost(pinnedPost.Id); err != nil && rpost.IsPinned {
t.Fatal("failed to pin post")
}
@@ -1157,7 +1157,7 @@ func TestDeletePost(t *testing.T) {
CheckUnauthorizedStatus(t, resp)
status, resp := th.SystemAdminClient.DeletePost(post.Id)
if status == false {
if !status {
t.Fatal("post should return status OK")
}
CheckNoError(t, resp)
@@ -1443,7 +1443,7 @@ func TestGetFileInfosForPost(t *testing.T) {
defer th.TearDown()
Client := th.Client
fileIds := make([]string, 3, 3)
fileIds := make([]string, 3)
if data, err := readTestFile("test.png"); err != nil {
t.Fatal(err)
} else {

Просмотреть файл

@@ -87,13 +87,13 @@ func TestReloadConfig(t *testing.T) {
flag, resp := Client.ReloadConfig()
CheckForbiddenStatus(t, resp)
if flag == true {
if flag {
t.Fatal("should not Reload the config due no permission.")
}
flag, resp = th.SystemAdminClient.ReloadConfig()
CheckNoError(t, resp)
if flag == false {
if !flag {
t.Fatal("should Reload the config")
}
@@ -285,13 +285,13 @@ func TestInvalidateCaches(t *testing.T) {
flag, resp := Client.InvalidateCaches()
CheckForbiddenStatus(t, resp)
if flag == true {
if flag {
t.Fatal("should not clean the cache due no permission.")
}
flag, resp = th.SystemAdminClient.InvalidateCaches()
CheckNoError(t, resp)
if flag == false {
if !flag {
t.Fatal("should clean the cache")
}
}

Просмотреть файл

@@ -604,7 +604,6 @@ func teamExists(c *Context, w http.ResponseWriter, r *http.Request) {
}
w.Write([]byte(model.MapBoolToJson(resp)))
return
}
func importTeam(c *Context, w http.ResponseWriter, r *http.Request) {

Просмотреть файл

@@ -282,7 +282,7 @@ func TestUpdateTeam(t *testing.T) {
uteam, resp = Client.UpdateTeam(team)
CheckNoError(t, resp)
if uteam.AllowOpenInvite != true {
if !uteam.AllowOpenInvite {
t.Fatal("Update failed")
}
@@ -419,7 +419,7 @@ func TestPatchTeam(t *testing.T) {
if rteam.InviteId != "inviteid1" {
t.Fatal("InviteId did not update properly")
}
if rteam.AllowOpenInvite != true {
if !rteam.AllowOpenInvite {
t.Fatal("AllowOpenInvite did not update properly")
}
@@ -1780,13 +1780,13 @@ func TestTeamExists(t *testing.T) {
exists, resp := Client.TeamExists(team.Name, "")
CheckNoError(t, resp)
if exists != true {
if !exists {
t.Fatal("team should exist")
}
exists, resp = Client.TeamExists("testingteam", "")
CheckNoError(t, resp)
if exists != false {
if exists {
t.Fatal("team should not exist")
}
@@ -1889,7 +1889,7 @@ func TestInviteUsersToTeam(t *testing.T) {
okMsg, resp := th.SystemAdminClient.InviteUsersToTeam(th.BasicTeam.Id, emailList)
CheckNoError(t, resp)
if okMsg != true {
if !okMsg {
t.Fatal("should return true")
}

Просмотреть файл

@@ -821,7 +821,7 @@ func TestGetProfileImage(t *testing.T) {
data, resp := Client.GetProfileImage(user.Id, "")
CheckNoError(t, resp)
if data == nil || len(data) == 0 {
if len(data) == 0 {
t.Fatal("Should not be empty")
}
@@ -1860,7 +1860,7 @@ func TestRevokeSessions(t *testing.T) {
CheckBadRequestStatus(t, resp)
status, resp := Client.RevokeSession(user.Id, session.Id)
if status == false {
if !status {
t.Fatal("user session revoke unsuccessful")
}
CheckNoError(t, resp)
@@ -1912,7 +1912,7 @@ func TestRevokeAllSessions(t *testing.T) {
CheckBadRequestStatus(t, resp)
status, resp := Client.RevokeAllSessions(user.Id)
if status == false {
if !status {
t.Fatal("user all sessions revoke unsuccessful")
}
CheckNoError(t, resp)