diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-04-27 14:12:01 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-04-27 14:12:01 -0700 |
commit | eb9ff34fcfa51cd8205841a02f3d3d61ec5be8fa (patch) | |
tree | ed01fd9488bd86f6c2daf0b299dff5beb43973db /api4/system_test.go | |
parent | 2386acb3ddabd8827e21b1862c338a8b13a25de6 (diff) | |
parent | 2e6b3da1d3466db379fef0d61a23e2878d17ee9d (diff) | |
download | chat-eb9ff34fcfa51cd8205841a02f3d3d61ec5be8fa.tar.gz chat-eb9ff34fcfa51cd8205841a02f3d3d61ec5be8fa.tar.bz2 chat-eb9ff34fcfa51cd8205841a02f3d3d61ec5be8fa.zip |
Merge branch 'master' into advanced-permissions-phase-2
Diffstat (limited to 'api4/system_test.go')
-rw-r--r-- | api4/system_test.go | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/api4/system_test.go b/api4/system_test.go index f74d91563..c0fde6c39 100644 --- a/api4/system_test.go +++ b/api4/system_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - l4g "github.com/alecthomas/log4go" + "github.com/mattermost/mattermost-server/mlog" "github.com/mattermost/mattermost-server/model" "github.com/stretchr/testify/assert" ) @@ -392,7 +392,7 @@ func TestGetLogs(t *testing.T) { Client := th.Client for i := 0; i < 20; i++ { - l4g.Info(i) + mlog.Info(fmt.Sprint(i)) } logs, resp := th.SystemAdminClient.GetLogs(0, 10) @@ -534,6 +534,28 @@ func TestGetAnalyticsOld(t *testing.T) { _, resp = th.SystemAdminClient.GetAnalyticsOld("", th.BasicTeam.Id) CheckNoError(t, resp) + rows2, resp2 := th.SystemAdminClient.GetAnalyticsOld("standard", "") + CheckNoError(t, resp2) + assert.Equal(t, "total_websocket_connections", rows2[5].Name) + assert.Equal(t, float64(0), rows2[5].Value) + + WebSocketClient, err := th.CreateWebSocketClient() + if err != nil { + t.Fatal(err) + } + + rows2, resp2 = th.SystemAdminClient.GetAnalyticsOld("standard", "") + CheckNoError(t, resp2) + assert.Equal(t, "total_websocket_connections", rows2[5].Name) + assert.Equal(t, float64(1), rows2[5].Value) + + WebSocketClient.Close() + + rows2, resp2 = th.SystemAdminClient.GetAnalyticsOld("standard", "") + CheckNoError(t, resp2) + assert.Equal(t, "total_websocket_connections", rows2[5].Name) + assert.Equal(t, float64(0), rows2[5].Value) + Client.Logout() _, resp = Client.GetAnalyticsOld("", th.BasicTeam.Id) CheckUnauthorizedStatus(t, resp) |