forked from EnterpriseyIntranet/nextcloud-API
-
Notifications
You must be signed in to change notification settings - Fork 8
/
test_apps.py
34 lines (27 loc) · 1.05 KB
/
test_apps.py
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
from .base import BaseTestCase
class TestApps(BaseTestCase):
def test_get_enable_disable(self):
res = self.nxc.get_apps()
assert res.is_ok
apps_list = res.data['apps']
assert len(apps_list) > 0
# app to edit
app = apps_list[0]
# disable app
res = self.nxc.disable_app(app)
assert res.is_ok
enabled_apps_list = self.nxc.get_apps(filter="enabled").data['apps']
assert app not in enabled_apps_list
disabled_apps_list = self.nxc.get_apps(filter="disabled").data['apps'].values()
assert app in disabled_apps_list
# enable app
res = self.nxc.enable_app(app)
assert res.is_ok
enabled_apps_list = self.nxc.get_apps(filter="enabled").data['apps']
assert app in enabled_apps_list
disabled_apps_list = self.nxc.get_apps(filter="disabled").data['apps'].values()
assert app not in disabled_apps_list
# get app
res = self.nxc.get_app(app)
assert res.is_ok
assert res.data['id'] == app