rocketchat-API 3.4.0__tar.gz → 3.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.github/workflows/release.yml +3 -3
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.github/workflows/test.yml +1 -1
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/PKG-INFO +1 -1
- rocketchat_api-3.6.0/rocketchat_API/APISections/custom_sounds.py +12 -0
- rocketchat_api-3.6.0/rocketchat_API/APISections/custom_user_status.py +41 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/licenses.py +4 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/rooms.py +14 -3
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/rocketchat.py +4 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API.egg-info/PKG-INFO +1 -1
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API.egg-info/SOURCES.txt +4 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/conftest.py +12 -0
- rocketchat_api-3.6.0/tests/test_custom_sounds.py +79 -0
- rocketchat_api-3.6.0/tests/test_custom_user_status.py +69 -0
- rocketchat_api-3.6.0/tests/test_licenses.py +22 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_rooms.py +41 -0
- rocketchat_api-3.4.0/tests/test_licenses.py +0 -3
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.coveragerc +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.deepsource.toml +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.editorconfig +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.github/actions/test_rocketchat/action.yml +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.github/dependabot.yml +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.github/workflows/lint.yml +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.github/workflows/test_latest.yml +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.github/workflows/test_manually.yml +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/.gitignore +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/CONTRIBUTING.md +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/LICENSE.txt +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/README.md +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/bandit.yml +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/docker-compose.yml +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/pyproject.toml +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/qodana.yaml +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APIExceptions/RocketExceptions.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APIExceptions/__init__.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/__init__.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/assets.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/banners.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/base.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/channels.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/chat.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/custom_emoji.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/dm.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/groups.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/integrations.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/invites.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/livechat.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/miscellaneous.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/moderation.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/permissions.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/roles.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/settings.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/statistics.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/subscriptions.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/teams.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/users.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/users_engagement.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/__init__.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API.egg-info/dependency_links.txt +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API.egg-info/requires.txt +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API.egg-info/top_level.txt +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/setup.cfg +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/__init__.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/assets/avatar.png +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/assets/avatar.svg +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/assets/logo.png +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_assets.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_banners.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_channels.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_chat.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_custom_emoji.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_dms.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_exceptions.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_groups.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_integrations.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_invites.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_livechat.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_moderation.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_paginated.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_permissions.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_roles.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_server.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_settings.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_subscriptions.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_teams.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_user.py +0 -0
- {rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/tests/test_users_engagement.py +0 -0
|
@@ -29,10 +29,10 @@ jobs:
|
|
|
29
29
|
- name: Publish package distributions to PyPI
|
|
30
30
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
31
31
|
- name: Announce release
|
|
32
|
-
uses: jadolg/rocketchat-notification-action@
|
|
32
|
+
uses: jadolg/rocketchat-notification-action@v3.0.0
|
|
33
33
|
with:
|
|
34
34
|
server: https://open.rocket.chat
|
|
35
35
|
message: A new version (${{ github.event.release.tag_name }}) has been released! ${{ github.event.release.html_url }}
|
|
36
|
-
user: ${{ secrets.
|
|
37
|
-
|
|
36
|
+
user-id: ${{ secrets.ROCKETCHAT_USER_ID }}
|
|
37
|
+
auth-token: ${{ secrets.ROCKETCHAT_AUTH_TOKEN }}
|
|
38
38
|
channel: "#python_rocketchat_api"
|
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
fail-fast: false
|
|
16
16
|
matrix:
|
|
17
17
|
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
|
|
18
|
-
rocket-chat-version: [ '7.
|
|
18
|
+
rocket-chat-version: [ '7.11.6', '7.12.6', '7.13.5' , '8.0.3', '8.1.2', '8.2.1', '8.3.1']
|
|
19
19
|
steps:
|
|
20
20
|
- name: Checkout
|
|
21
21
|
uses: actions/checkout@v6.0.2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rocketchat_API
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.6.0
|
|
4
4
|
Summary: Python API wrapper for Rocket.Chat
|
|
5
5
|
Author-email: "Jorge Alberto Díaz Orozco (Akiel)" <diazorozcoj@gmail.com>
|
|
6
6
|
Maintainer-email: "Jorge Alberto Díaz Orozco (Akiel)" <diazorozcoj@gmail.com>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from rocketchat_API.APISections.base import RocketChatBase, paginated
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class RocketChatCustomSounds(RocketChatBase):
|
|
5
|
+
@paginated("sounds")
|
|
6
|
+
def custom_sounds_list(self, **kwargs):
|
|
7
|
+
"""Retrieves all custom sounds."""
|
|
8
|
+
return self.call_api_get("custom-sounds.list", kwargs=kwargs)
|
|
9
|
+
|
|
10
|
+
def custom_sounds_get_one(self, sound_id, **kwargs):
|
|
11
|
+
"""Retrieves a single custom sound by its _id."""
|
|
12
|
+
return self.call_api_get("custom-sounds.getOne", _id=sound_id, kwargs=kwargs)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from rocketchat_API.APISections.base import RocketChatBase, paginated
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class RocketChatCustomUserStatus(RocketChatBase):
|
|
5
|
+
@paginated("statuses")
|
|
6
|
+
def custom_user_status_list(self, **kwargs):
|
|
7
|
+
"""Lists all available custom user's status."""
|
|
8
|
+
return self.call_api_get("custom-user-status.list", kwargs=kwargs)
|
|
9
|
+
|
|
10
|
+
def custom_user_status_create(self, name, status_type, **kwargs):
|
|
11
|
+
"""Creates custom user status.
|
|
12
|
+
|
|
13
|
+
:param name: The name of the custom status.
|
|
14
|
+
:param status_type: The statusType of the custom status. Valid status type includes: Online, Busy, Away, Offline.
|
|
15
|
+
"""
|
|
16
|
+
return self.call_api_post(
|
|
17
|
+
"custom-user-status.create",
|
|
18
|
+
name=name,
|
|
19
|
+
statusType=status_type,
|
|
20
|
+
kwargs=kwargs,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
def custom_user_status_delete(self, custom_user_status_id, **kwargs):
|
|
24
|
+
"""Deletes a custom user status."""
|
|
25
|
+
return self.call_api_post(
|
|
26
|
+
"custom-user-status.delete",
|
|
27
|
+
customUserStatusId=custom_user_status_id,
|
|
28
|
+
kwargs=kwargs,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
def custom_user_status_update(
|
|
32
|
+
self, custom_user_status_id, name, status_type, **kwargs
|
|
33
|
+
):
|
|
34
|
+
"""Updates a custom user status."""
|
|
35
|
+
return self.call_api_post(
|
|
36
|
+
"custom-user-status.update",
|
|
37
|
+
_id=custom_user_status_id,
|
|
38
|
+
name=name,
|
|
39
|
+
statusType=status_type,
|
|
40
|
+
kwargs=kwargs,
|
|
41
|
+
)
|
|
@@ -6,3 +6,7 @@ class RocketChatLicenses(RocketChatBase):
|
|
|
6
6
|
def licenses_info(self, **kwargs):
|
|
7
7
|
"""Retrieves a list of all registered licenses in the workspace."""
|
|
8
8
|
return self.call_api_get("licenses.info", kwargs=kwargs)
|
|
9
|
+
|
|
10
|
+
def licenses_max_active_users(self, **kwargs):
|
|
11
|
+
"""Retrieves a list of the maximum active users."""
|
|
12
|
+
return self.call_api_get("licenses.maxActiveUsers", kwargs=kwargs)
|
|
@@ -69,11 +69,22 @@ class RocketChatRooms(RocketChatBase):
|
|
|
69
69
|
"""Upload media files to a room."""
|
|
70
70
|
files = {
|
|
71
71
|
"file": (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
file
|
|
73
|
+
if isinstance(file, (list, tuple))
|
|
74
|
+
else (
|
|
75
|
+
os.path.basename(file),
|
|
76
|
+
open(file, "rb"),
|
|
77
|
+
mimetypes.guess_type(file)[0],
|
|
78
|
+
)
|
|
75
79
|
),
|
|
76
80
|
}
|
|
77
81
|
return self.call_api_post(
|
|
78
82
|
"rooms.media/" + room_id, kwargs=kwargs, use_json=False, files=files
|
|
79
83
|
)
|
|
84
|
+
|
|
85
|
+
def rooms_media_confirm(self, room_id, file_id, **kwargs):
|
|
86
|
+
"""Confirm a previously uploaded media file in a room."""
|
|
87
|
+
return self.call_api_post(
|
|
88
|
+
"rooms.mediaConfirm/" + room_id + "/" + file_id,
|
|
89
|
+
kwargs=kwargs,
|
|
90
|
+
)
|
|
@@ -6,6 +6,8 @@ from rocketchat_API.APISections.channels import RocketChatChannels
|
|
|
6
6
|
from rocketchat_API.APISections.chat import RocketChatChat
|
|
7
7
|
from rocketchat_API.APISections.dm import RocketChatDM
|
|
8
8
|
from rocketchat_API.APISections.custom_emoji import RocketChatCustomEmoji
|
|
9
|
+
from rocketchat_API.APISections.custom_sounds import RocketChatCustomSounds
|
|
10
|
+
from rocketchat_API.APISections.custom_user_status import RocketChatCustomUserStatus
|
|
9
11
|
from rocketchat_API.APISections.groups import RocketChatGroups
|
|
10
12
|
from rocketchat_API.APISections.integrations import RocketChatIntegrations
|
|
11
13
|
from rocketchat_API.APISections.invites import RocketChatInvites
|
|
@@ -31,6 +33,8 @@ class RocketChat(
|
|
|
31
33
|
RocketChatChat,
|
|
32
34
|
RocketChatDM,
|
|
33
35
|
RocketChatCustomEmoji,
|
|
36
|
+
RocketChatCustomSounds,
|
|
37
|
+
RocketChatCustomUserStatus,
|
|
34
38
|
RocketChatGroups,
|
|
35
39
|
RocketChatIntegrations,
|
|
36
40
|
RocketChatInvites,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rocketchat_API
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.6.0
|
|
4
4
|
Summary: Python API wrapper for Rocket.Chat
|
|
5
5
|
Author-email: "Jorge Alberto Díaz Orozco (Akiel)" <diazorozcoj@gmail.com>
|
|
6
6
|
Maintainer-email: "Jorge Alberto Díaz Orozco (Akiel)" <diazorozcoj@gmail.com>
|
|
@@ -34,6 +34,8 @@ rocketchat_API/APISections/base.py
|
|
|
34
34
|
rocketchat_API/APISections/channels.py
|
|
35
35
|
rocketchat_API/APISections/chat.py
|
|
36
36
|
rocketchat_API/APISections/custom_emoji.py
|
|
37
|
+
rocketchat_API/APISections/custom_sounds.py
|
|
38
|
+
rocketchat_API/APISections/custom_user_status.py
|
|
37
39
|
rocketchat_API/APISections/dm.py
|
|
38
40
|
rocketchat_API/APISections/groups.py
|
|
39
41
|
rocketchat_API/APISections/integrations.py
|
|
@@ -58,6 +60,8 @@ tests/test_banners.py
|
|
|
58
60
|
tests/test_channels.py
|
|
59
61
|
tests/test_chat.py
|
|
60
62
|
tests/test_custom_emoji.py
|
|
63
|
+
tests/test_custom_sounds.py
|
|
64
|
+
tests/test_custom_user_status.py
|
|
61
65
|
tests/test_dms.py
|
|
62
66
|
tests/test_exceptions.py
|
|
63
67
|
tests/test_groups.py
|
|
@@ -78,6 +78,18 @@ def secondary_user(logged_rocket):
|
|
|
78
78
|
logged_rocket.users_delete(_testuser_id)
|
|
79
79
|
|
|
80
80
|
|
|
81
|
+
@pytest.fixture
|
|
82
|
+
def skip_if_version_under(rocket):
|
|
83
|
+
import semver
|
|
84
|
+
|
|
85
|
+
def _skip_if_version_under(minimum_version):
|
|
86
|
+
parse = lambda v: semver.Version.parse(v, optional_minor_and_patch=True)
|
|
87
|
+
if parse(rocket.info()["version"]) < parse(minimum_version):
|
|
88
|
+
pytest.skip(f"Requires Rocket.Chat >= {minimum_version}")
|
|
89
|
+
|
|
90
|
+
return _skip_if_version_under
|
|
91
|
+
|
|
92
|
+
|
|
81
93
|
@pytest.fixture
|
|
82
94
|
def skip_if_no_license(logged_rocket):
|
|
83
95
|
try:
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import uuid
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def _sound_name():
|
|
6
|
+
return "test_sound_" + str(uuid.uuid1()).replace("-", "")[:12]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _create_sound(logged_rocket, name):
|
|
10
|
+
"""Create a custom sound entry via method.call and return its _id."""
|
|
11
|
+
result = logged_rocket.call_api_post(
|
|
12
|
+
"method.call/insertOrUpdateSound",
|
|
13
|
+
message=json.dumps(
|
|
14
|
+
{
|
|
15
|
+
"msg": "method",
|
|
16
|
+
"id": "1",
|
|
17
|
+
"method": "insertOrUpdateSound",
|
|
18
|
+
"params": [{"name": name, "extension": "mp3", "newFile": True}],
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
)
|
|
22
|
+
return json.loads(result["message"])["result"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _delete_sound(logged_rocket, sound_id):
|
|
26
|
+
"""Delete a custom sound entry via method.call."""
|
|
27
|
+
logged_rocket.call_api_post(
|
|
28
|
+
"method.call/deleteCustomSound",
|
|
29
|
+
message=json.dumps(
|
|
30
|
+
{
|
|
31
|
+
"msg": "method",
|
|
32
|
+
"id": "1",
|
|
33
|
+
"method": "deleteCustomSound",
|
|
34
|
+
"params": [sound_id],
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def test_custom_sounds_list(logged_rocket):
|
|
41
|
+
result = list(logged_rocket.custom_sounds_list())
|
|
42
|
+
assert isinstance(result, list)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def test_custom_sounds_list_structure(logged_rocket):
|
|
46
|
+
name = _sound_name()
|
|
47
|
+
sound_id = _create_sound(logged_rocket, name)
|
|
48
|
+
try:
|
|
49
|
+
sounds = list(logged_rocket.custom_sounds_list())
|
|
50
|
+
assert any(s["_id"] == sound_id for s in sounds)
|
|
51
|
+
sound = next(s for s in sounds if s["_id"] == sound_id)
|
|
52
|
+
assert "name" in sound
|
|
53
|
+
assert "extension" in sound
|
|
54
|
+
finally:
|
|
55
|
+
_delete_sound(logged_rocket, sound_id)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def test_custom_sounds_list_filter_by_name(logged_rocket):
|
|
59
|
+
name = _sound_name()
|
|
60
|
+
sound_id = _create_sound(logged_rocket, name)
|
|
61
|
+
try:
|
|
62
|
+
sounds = list(logged_rocket.custom_sounds_list(name=name))
|
|
63
|
+
assert len(sounds) >= 1
|
|
64
|
+
assert all(name.lower() in s["name"].lower() for s in sounds)
|
|
65
|
+
finally:
|
|
66
|
+
_delete_sound(logged_rocket, sound_id)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def test_custom_sounds_get_one(logged_rocket, skip_if_version_under):
|
|
70
|
+
skip_if_version_under("8.3.0")
|
|
71
|
+
name = _sound_name()
|
|
72
|
+
sound_id = _create_sound(logged_rocket, name)
|
|
73
|
+
try:
|
|
74
|
+
result = logged_rocket.custom_sounds_get_one(sound_id)
|
|
75
|
+
assert "sound" in result
|
|
76
|
+
assert result["sound"]["_id"] == sound_id
|
|
77
|
+
assert result["sound"]["name"] == name
|
|
78
|
+
finally:
|
|
79
|
+
_delete_sound(logged_rocket, sound_id)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import uuid
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@pytest.fixture
|
|
7
|
+
def status_name():
|
|
8
|
+
return "test_status_" + str(uuid.uuid1()).replace("-", "")[:12]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@pytest.fixture
|
|
12
|
+
def created_status(logged_rocket, status_name):
|
|
13
|
+
result = logged_rocket.custom_user_status_create(
|
|
14
|
+
name=status_name, status_type="online"
|
|
15
|
+
)
|
|
16
|
+
status = result.get("customUserStatus")
|
|
17
|
+
assert status is not None
|
|
18
|
+
|
|
19
|
+
yield status
|
|
20
|
+
|
|
21
|
+
logged_rocket.custom_user_status_delete(custom_user_status_id=status["_id"])
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_custom_user_status_list(logged_rocket, created_status):
|
|
25
|
+
statuses = list(logged_rocket.custom_user_status_list())
|
|
26
|
+
assert any(s["_id"] == created_status["_id"] for s in statuses)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_custom_user_status_create_delete(logged_rocket):
|
|
30
|
+
name = "test_status_" + str(uuid.uuid1()).replace("-", "")[:12]
|
|
31
|
+
result = logged_rocket.custom_user_status_create(name=name, status_type="busy")
|
|
32
|
+
status = result.get("customUserStatus")
|
|
33
|
+
assert status is not None
|
|
34
|
+
assert status["name"] == name
|
|
35
|
+
assert status["statusType"] == "busy"
|
|
36
|
+
|
|
37
|
+
logged_rocket.custom_user_status_delete(custom_user_status_id=status["_id"])
|
|
38
|
+
|
|
39
|
+
statuses = list(logged_rocket.custom_user_status_list())
|
|
40
|
+
assert not any(s["_id"] == status["_id"] for s in statuses)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def test_custom_user_status_update(logged_rocket, created_status):
|
|
44
|
+
new_name = created_status["name"] + "_upd"
|
|
45
|
+
result = logged_rocket.custom_user_status_update(
|
|
46
|
+
custom_user_status_id=created_status["_id"],
|
|
47
|
+
name=new_name,
|
|
48
|
+
status_type="away",
|
|
49
|
+
)
|
|
50
|
+
updated = result.get("customUserStatus")
|
|
51
|
+
assert updated is not None
|
|
52
|
+
assert updated["name"] == new_name
|
|
53
|
+
assert updated["statusType"] == "away"
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def test_custom_user_status_create_all_types(logged_rocket):
|
|
57
|
+
created_ids = []
|
|
58
|
+
for status_type in ("online", "busy", "away", "offline"):
|
|
59
|
+
name = "test_" + status_type + "_" + str(uuid.uuid1()).replace("-", "")[:8]
|
|
60
|
+
result = logged_rocket.custom_user_status_create(
|
|
61
|
+
name=name, status_type=status_type
|
|
62
|
+
)
|
|
63
|
+
status = result.get("customUserStatus")
|
|
64
|
+
assert status is not None
|
|
65
|
+
assert status["statusType"] == status_type
|
|
66
|
+
created_ids.append(status["_id"])
|
|
67
|
+
|
|
68
|
+
for sid in created_ids:
|
|
69
|
+
logged_rocket.custom_user_status_delete(custom_user_status_id=sid)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
def test_licenses_info_works_without_license(logged_rocket):
|
|
2
|
+
licenses_info = logged_rocket.licenses_info()
|
|
3
|
+
assert "license" in licenses_info
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_licenses_info(logged_rocket, skip_if_no_license, skip_if_version_under):
|
|
7
|
+
skip_if_version_under("8.1.0")
|
|
8
|
+
licenses_info = logged_rocket.licenses_info()
|
|
9
|
+
assert "license" in licenses_info
|
|
10
|
+
license_data = licenses_info["license"]
|
|
11
|
+
assert "activeModules" in license_data
|
|
12
|
+
assert "hasValidLicense" in license_data
|
|
13
|
+
assert "tags" in license_data
|
|
14
|
+
assert "limits" in license_data
|
|
15
|
+
assert isinstance(license_data["activeModules"], list)
|
|
16
|
+
assert isinstance(license_data["tags"], list)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def test_licenses_max_active_users(logged_rocket, skip_if_no_license):
|
|
20
|
+
result = logged_rocket.licenses_max_active_users()
|
|
21
|
+
assert "maxActiveUsers" in result
|
|
22
|
+
assert "activeUsers" in result
|
|
@@ -15,6 +15,47 @@ def test_rooms_media(logged_rocket):
|
|
|
15
15
|
assert str(rooms_media.get("file").get("url")).endswith("avatar.png")
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
def test_rooms_media_array_file(logged_rocket):
|
|
19
|
+
with open("tests/assets/avatar.png", "rb") as avatar_file:
|
|
20
|
+
avatar_bytes = avatar_file.read()
|
|
21
|
+
|
|
22
|
+
rooms_media = logged_rocket.rooms_media(
|
|
23
|
+
"GENERAL",
|
|
24
|
+
file=("avatar.png", avatar_bytes, "image/png"),
|
|
25
|
+
description="hey there",
|
|
26
|
+
)
|
|
27
|
+
assert str(rooms_media.get("file").get("url")).endswith("avatar.png")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def test_rooms_media_array_file_with_list(logged_rocket):
|
|
31
|
+
with open("tests/assets/avatar.png", "rb") as avatar_file:
|
|
32
|
+
avatar_bytes = avatar_file.read()
|
|
33
|
+
|
|
34
|
+
rooms_media = logged_rocket.rooms_media(
|
|
35
|
+
"GENERAL",
|
|
36
|
+
file=["avatar.png", avatar_bytes, "image/png"], # list instead of tuple
|
|
37
|
+
description="hey there",
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
assert str(rooms_media.get("file").get("url")).endswith("avatar.png")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def test_rooms_media_confirm(logged_rocket):
|
|
44
|
+
uploaded_media = logged_rocket.rooms_media(
|
|
45
|
+
"GENERAL", file="tests/assets/avatar.png"
|
|
46
|
+
)
|
|
47
|
+
file_id = str(uploaded_media.get("file").get("_id"))
|
|
48
|
+
assert file_id
|
|
49
|
+
|
|
50
|
+
confirmed_media = logged_rocket.rooms_media_confirm(
|
|
51
|
+
room_id="GENERAL",
|
|
52
|
+
file_id=file_id,
|
|
53
|
+
msg="confirmed upload",
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
assert confirmed_media.get("message").get("_id")
|
|
57
|
+
|
|
58
|
+
|
|
18
59
|
def test_rooms_get(logged_rocket):
|
|
19
60
|
rooms_get = logged_rocket.rooms_get()
|
|
20
61
|
assert "update" in rooms_get
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APIExceptions/RocketExceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rocketchat_api-3.4.0 → rocketchat_api-3.6.0}/rocketchat_API/APISections/users_engagement.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|