2018-10-16 12:38:32 +00:00
|
|
|
package gonextcloud
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAppsConfig(t *testing.T) {
|
|
|
|
c = nil
|
|
|
|
if err := initClient(); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2018-10-21 12:53:12 +00:00
|
|
|
ac, err := c.AppsConfig.Get()
|
2018-10-16 12:38:32 +00:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.NotEmpty(t, ac)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestAppsConfigList(t *testing.T) {
|
|
|
|
c = nil
|
|
|
|
if err := initClient(); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2018-10-21 12:53:12 +00:00
|
|
|
a, err := c.AppsConfig.List()
|
2018-10-16 12:38:32 +00:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Contains(t, a, "files")
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestAppsConfigKeys(t *testing.T) {
|
|
|
|
c = nil
|
|
|
|
if err := initClient(); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2018-10-21 12:53:12 +00:00
|
|
|
ks, err := c.AppsConfig.Keys("activity")
|
2018-10-16 12:38:32 +00:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Contains(t, ks, "enabled")
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestAppsConfigValue(t *testing.T) {
|
|
|
|
c = nil
|
|
|
|
if err := initClient(); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2018-10-21 12:53:12 +00:00
|
|
|
k, err := c.AppsConfig.Value("files", "enabled")
|
2018-10-16 12:38:32 +00:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Equal(t, "yes", k)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestAppConfigDetails(t *testing.T) {
|
|
|
|
c = nil
|
|
|
|
if err := initClient(); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2018-10-21 12:53:12 +00:00
|
|
|
d, err := c.AppsConfig.Details("activity")
|
2018-10-16 12:38:32 +00:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.NotEmpty(t, d)
|
|
|
|
}
|