Added unit test and fixed errors

Этот коммит содержится в:
JoramWilander
2016-01-22 10:19:02 -05:00
родитель bbcf00f02e
Коммит 0d239a1a9e
4 изменённых файлов: 76 добавлений и 11 удалений

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

@@ -434,7 +434,7 @@ func (c *Client) TestEmail(config *Config) (*Result, *AppError) {
}
}
func (c *Client) GetAnalytics(teamId, name string) (*Result, *AppError) {
func (c *Client) GetTeamAnalytics(teamId, name string) (*Result, *AppError) {
if r, err := c.DoApiGet("/admin/analytics/"+teamId+"/"+name, "", ""); err != nil {
return nil, err
} else {
@@ -443,6 +443,15 @@ func (c *Client) GetAnalytics(teamId, name string) (*Result, *AppError) {
}
}
func (c *Client) GetSystemAnalytics(name string) (*Result, *AppError) {
if r, err := c.DoApiGet("/admin/analytics/"+name, "", ""); err != nil {
return nil, err
} else {
return &Result{r.Header.Get(HEADER_REQUEST_ID),
r.Header.Get(HEADER_ETAG_SERVER), AnalyticsRowsFromJson(r.Body)}, nil
}
}
func (c *Client) CreateChannel(channel *Channel) (*Result, *AppError) {
if r, err := c.DoApiPost("/channels/create", channel.ToJson()); err != nil {
return nil, err