Passing t to all tests setup functions (#13841)

* Passing t to all tests setup functions

* Fixing build
Этот коммит содержится в:
Jesús Espino
2020-02-10 19:31:41 +01:00
коммит произвёл GitHub
родитель 3b732fe257
Коммит 1d1ab03c38
73 изменённых файлов: 646 добавлений и 632 удалений

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

@@ -19,7 +19,7 @@ import (
)
func TestCreateChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
team := th.BasicTeam
@@ -126,7 +126,7 @@ func TestCreateChannel(t *testing.T) {
}
func TestUpdateChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
team := th.BasicTeam
@@ -228,7 +228,7 @@ func TestUpdateChannel(t *testing.T) {
}
func TestPatchChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -316,7 +316,7 @@ func TestPatchChannel(t *testing.T) {
}
func TestCreateDirectChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
user1 := th.BasicUser
@@ -360,7 +360,7 @@ func TestCreateDirectChannel(t *testing.T) {
}
func TestCreateDirectChannelAsGuest(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
user1 := th.BasicUser
@@ -405,7 +405,7 @@ func TestCreateDirectChannelAsGuest(t *testing.T) {
}
func TestDeleteDirectChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
user := th.BasicUser
@@ -422,7 +422,7 @@ func TestDeleteDirectChannel(t *testing.T) {
}
func TestCreateGroupChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
user := th.BasicUser
@@ -479,7 +479,7 @@ func TestCreateGroupChannel(t *testing.T) {
}
func TestCreateGroupChannelAsGuest(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
user1 := th.BasicUser
@@ -540,7 +540,7 @@ func TestCreateGroupChannelAsGuest(t *testing.T) {
}
func TestDeleteGroupChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
user := th.BasicUser
@@ -560,7 +560,7 @@ func TestDeleteGroupChannel(t *testing.T) {
}
func TestGetChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -603,7 +603,7 @@ func TestGetChannel(t *testing.T) {
}
func TestGetDeletedChannelsForTeam(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
team := th.BasicTeam
@@ -664,7 +664,7 @@ func TestGetDeletedChannelsForTeam(t *testing.T) {
}
func TestGetPublicChannelsForTeam(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
team := th.BasicTeam
@@ -725,7 +725,7 @@ func TestGetPublicChannelsForTeam(t *testing.T) {
}
func TestGetPublicChannelsByIdsForTeam(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
teamId := th.BasicTeam.Id
@@ -776,7 +776,7 @@ func TestGetPublicChannelsByIdsForTeam(t *testing.T) {
}
func TestGetChannelsForTeamForUser(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -820,7 +820,7 @@ func TestGetChannelsForTeamForUser(t *testing.T) {
}
func TestGetAllChannels(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -850,7 +850,7 @@ func TestGetAllChannels(t *testing.T) {
}
func TestGetAllChannelsWithCount(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -881,7 +881,7 @@ func TestGetAllChannelsWithCount(t *testing.T) {
}
func TestSearchChannels(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -963,7 +963,7 @@ func TestSearchChannels(t *testing.T) {
}
func TestSearchArchivedChannels(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1057,7 +1057,7 @@ func TestSearchArchivedChannels(t *testing.T) {
}
func TestSearchAllChannels(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1088,7 +1088,7 @@ func TestSearchAllChannels(t *testing.T) {
}
func TestSearchAllChannelsPaged(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1106,7 +1106,7 @@ func TestSearchAllChannelsPaged(t *testing.T) {
}
func TestSearchGroupChannels(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1164,7 +1164,7 @@ func TestSearchGroupChannels(t *testing.T) {
}
func TestDeleteChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
team := th.BasicTeam
@@ -1247,7 +1247,7 @@ func TestDeleteChannel(t *testing.T) {
}
func TestDeleteChannel2(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
user := th.BasicUser
@@ -1322,7 +1322,7 @@ func TestDeleteChannel2(t *testing.T) {
}
func TestConvertChannelToPrivate(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1384,7 +1384,7 @@ func TestConvertChannelToPrivate(t *testing.T) {
}
func TestUpdateChannelPrivacy(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1446,7 +1446,7 @@ func TestUpdateChannelPrivacy(t *testing.T) {
}
func TestRestoreChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1472,7 +1472,7 @@ func TestRestoreChannel(t *testing.T) {
}
func TestGetChannelByName(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1522,7 +1522,7 @@ func TestGetChannelByName(t *testing.T) {
}
func TestGetChannelByNameForTeamName(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1557,7 +1557,7 @@ func TestGetChannelByNameForTeamName(t *testing.T) {
}
func TestGetChannelMembers(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1600,7 +1600,7 @@ func TestGetChannelMembers(t *testing.T) {
}
func TestGetChannelMembersByIds(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1638,7 +1638,7 @@ func TestGetChannelMembersByIds(t *testing.T) {
}
func TestGetChannelMember(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1679,7 +1679,7 @@ func TestGetChannelMember(t *testing.T) {
}
func TestGetChannelMembersForUser(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1719,7 +1719,7 @@ func TestGetChannelMembersForUser(t *testing.T) {
}
func TestViewChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1789,7 +1789,7 @@ func TestViewChannel(t *testing.T) {
}
func TestGetChannelUnread(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
user := th.BasicUser
@@ -1830,7 +1830,7 @@ func TestGetChannelUnread(t *testing.T) {
}
func TestGetChannelStats(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
channel := th.CreatePrivateChannel()
@@ -1867,7 +1867,7 @@ func TestGetChannelStats(t *testing.T) {
}
func TestGetPinnedPosts(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
channel := th.BasicChannel
@@ -1900,7 +1900,7 @@ func TestGetPinnedPosts(t *testing.T) {
}
func TestUpdateChannelRoles(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -1973,7 +1973,7 @@ func TestUpdateChannelRoles(t *testing.T) {
}
func TestUpdateChannelMemberSchemeRoles(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
SystemAdminClient := th.SystemAdminClient
WebSocketClient, err := th.CreateWebSocketClient()
@@ -2097,7 +2097,7 @@ func TestUpdateChannelMemberSchemeRoles(t *testing.T) {
}
func TestUpdateChannelNotifyProps(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -2138,7 +2138,7 @@ func TestUpdateChannelNotifyProps(t *testing.T) {
}
func TestAddChannelMember(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
user := th.BasicUser
@@ -2304,7 +2304,7 @@ func TestAddChannelMember(t *testing.T) {
}
func TestAddChannelMemberAddMyself(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
user := th.CreateUser()
@@ -2380,7 +2380,7 @@ func TestAddChannelMemberAddMyself(t *testing.T) {
}
func TestRemoveChannelMember(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
user1 := th.BasicUser
user2 := th.BasicUser2
team := th.BasicTeam
@@ -2598,7 +2598,7 @@ func TestRemoveChannelMember(t *testing.T) {
}
func TestAutocompleteChannels(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
// A private channel to make sure private channels are not used
@@ -2668,7 +2668,7 @@ func TestAutocompleteChannels(t *testing.T) {
}
func TestAutocompleteChannelsForSearch(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
th.LoginSystemAdminWithClient(th.SystemAdminClient)
@@ -2779,7 +2779,7 @@ func TestAutocompleteChannelsForSearch(t *testing.T) {
}
func TestUpdateChannelScheme(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
th.App.SetLicense(model.NewTestLicense(""))
@@ -2855,7 +2855,7 @@ func TestUpdateChannelScheme(t *testing.T) {
}
func TestGetChannelMembersTimezones(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
Client := th.Client
@@ -2898,7 +2898,7 @@ func TestGetChannelMembersTimezones(t *testing.T) {
}
func TestChannelMembersMinusGroupMembers(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
user1 := th.BasicUser