summaryrefslogtreecommitdiffstats
path: root/api/api_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/api_test.go')
-rw-r--r--api/api_test.go47
1 files changed, 0 insertions, 47 deletions
diff --git a/api/api_test.go b/api/api_test.go
deleted file mode 100644
index 94691ab4b..000000000
--- a/api/api_test.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-package api
-
-import (
- "github.com/mattermost/platform/model"
- "github.com/mattermost/platform/store"
- "github.com/mattermost/platform/utils"
-)
-
-var Client *model.Client
-
-func Setup() {
- if Srv == nil {
- utils.LoadConfig("config.json")
- utils.InitTranslations()
- utils.Cfg.TeamSettings.MaxUsersPerTeam = 50
- NewServer()
- StartServer()
- InitApi()
- Client = model.NewClient("http://localhost" + utils.Cfg.ServiceSettings.ListenAddress)
-
- Srv.Store.MarkSystemRanUnitTests()
- }
-}
-
-func SetupBenchmark() (*model.Team, *model.User, *model.Channel) {
- Setup()
-
- team := &model.Team{DisplayName: "Benchmark Team", Name: "z-z-" + model.NewId() + "a", Email: "benchmark@nowhere.com", Type: model.TEAM_OPEN}
- team = Client.Must(Client.CreateTeam(team)).Data.(*model.Team)
- user := &model.User{TeamId: team.Id, Email: model.NewId() + "success+test@simulator.amazonses.com", Nickname: "Mr. Benchmarker", Password: "pwd"}
- user = Client.Must(Client.CreateUser(user, "")).Data.(*model.User)
- store.Must(Srv.Store.User().VerifyEmail(user.Id))
- Client.LoginByEmail(team.Name, user.Email, "pwd")
- channel := &model.Channel{DisplayName: "Benchmark Channel", Name: "a" + model.NewId() + "a", Type: model.CHANNEL_OPEN, TeamId: team.Id}
- channel = Client.Must(Client.CreateChannel(channel)).Data.(*model.Channel)
-
- return team, user, channel
-}
-
-func TearDown() {
- if Srv != nil {
- StopServer()
- }
-}