-
Notifications
You must be signed in to change notification settings - Fork 1
/
server_test.go
57 lines (52 loc) · 1.18 KB
/
server_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package directus
import (
"context"
"encoding/json"
"testing"
"github.com/stretchr/testify/require"
)
func TestServerInfoUnmarshall(t *testing.T) {
data := []byte(`
{
"project": {
"project_name": "Directus",
"project_descriptor": null,
"project_logo": null,
"project_color": "#6644FF",
"default_appearance": "auto",
"default_theme_light": null,
"default_theme_dark": null,
"theme_light_overrides": null,
"theme_dark_overrides": null,
"default_language": "es-ES",
"public_foreground": null,
"public_favicon": null,
"public_note": null,
"custom_css": null,
"public_registration": false,
"public_registration_verify_email": true,
"public_background": null
},
"rateLimit": false,
"rateLimitGlobal": false,
"extensions": {
"limit": null
},
"queryLimit": {
"default": 100,
"max": -1
},
"websocket": false,
"version": "11.0.2"
}`,
)
var server ServerInfo
require.NoError(t, json.Unmarshal(data, &server))
require.EqualValues(t, server.Version, "11.0.2")
}
func TestServerInfo(t *testing.T) {
cli := initClient(t)
s, err := cli.Server.Info(context.Background())
require.NoError(t, err)
require.NotNil(t, s)
}