From 658e26e74c70636a0f4511412e94ad8ab84acf42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Mon, 11 Jul 2022 08:01:33 +0200 Subject: [PATCH 01/21] Create dependabot.yml --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..6a7695c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" From 5c92be2b82978389fef1aa9dd9fd2abe217219bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Mon, 8 Aug 2022 16:39:47 +0200 Subject: [PATCH 02/21] Fix mongodb connection --- docker-compose-test-server.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose-test-server.yml b/docker-compose-test-server.yml index bd041a6..49ec1f3 100644 --- a/docker-compose-test-server.yml +++ b/docker-compose-test-server.yml @@ -10,7 +10,7 @@ services: environment: - PORT=3000 - ROOT_URL=http://localhost:3000 - - MONGO_URL=mongodb://mongo:27017/rocketchat + - MONGO_URL=mongodb://mongo:27017/rocketchat?directConnection=true - MONGO_OPLOG_URL=mongodb://mongo:27017/local - OVERWRITE_SETTING_API_Enable_Rate_Limiter=false - OVERWRITE_SETTING_Accounts_TwoFactorAuthentication_Enforce_Password_Fallback=false @@ -22,6 +22,8 @@ services: mongo: image: mongo + ports: + - "27017:27017" restart: unless-stopped command: mongod --oplogSize 128 --replSet rs0 From 599a3793b483325ccf8bda259184d4b273e1a465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Mon, 8 Aug 2022 16:40:28 +0200 Subject: [PATCH 03/21] Remove password from reduced_args since register is now failing if we push more data than needed --- rocketchat_API/APISections/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rocketchat_API/APISections/base.py b/rocketchat_API/APISections/base.py index e9fab22..95a3750 100644 --- a/rocketchat_API/APISections/base.py +++ b/rocketchat_API/APISections/base.py @@ -86,6 +86,7 @@ def call_api_post(self, method, files=None, use_json=None, **kwargs): # Some methods use pass (users.register) and others password (users.create) if "password" in reduced_args and method != "users.create": reduced_args["pass"] = reduced_args["password"] + del reduced_args["password"] if use_json is None: # see https://requests.readthedocs.io/en/master/user/quickstart/#more-complicated-post-requests # > The json parameter is ignored if either data or files is passed. From 67e91b661cf2230321b17867dc322c10e0a0a034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Mon, 8 Aug 2022 20:19:39 +0200 Subject: [PATCH 04/21] Make room_id required on im.counters since the arguments changed their required/optional requirements --- rocketchat_API/APISections/im.py | 18 ++++++++---------- tests/test_ims.py | 4 +--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/rocketchat_API/APISections/im.py b/rocketchat_API/APISections/im.py index af8d803..cb41b95 100644 --- a/rocketchat_API/APISections/im.py +++ b/rocketchat_API/APISections/im.py @@ -33,17 +33,17 @@ def im_close(self, room_id, **kwargs): """Removes the direct message from the user’s list of direct messages.""" return self.call_api_post("im.close", roomId=room_id, kwargs=kwargs) - def im_members(self, room_id, **kwargs): + def im_members(self, room_id): """Retrieves members of a direct message.""" - return self.call_api_get("im.members", roomId=room_id, args=kwargs) + return self.call_api_get("im.members", roomId=room_id) - def im_messages(self, room_id=None, username=None, **kwargs): + def im_messages(self, room_id=None, username=None): """Retrieves direct messages from the server by username""" if room_id: - return self.call_api_get("im.messages", roomId=room_id, args=kwargs) + return self.call_api_get("im.messages", roomId=room_id) if username: - return self.call_api_get("im.messages", username=username, args=kwargs) + return self.call_api_get("im.messages", username=username) raise RocketMissingParamException("roomId or username required") @@ -65,10 +65,8 @@ def im_files(self, room_id=None, user_name=None, **kwargs): return self.call_api_get("im.files", username=user_name, kwargs=kwargs) raise RocketMissingParamException("roomId or username required") - def im_counters(self, room_id=None, user_name=None, **kwargs): + def im_counters(self, room_id, user_name=None): """Gets counters of direct messages.""" - if room_id: - return self.call_api_get("im.counters", roomId=room_id, kwargs=kwargs) if user_name: - return self.call_api_get("im.counters", username=user_name, kwargs=kwargs) - raise RocketMissingParamException("roomId or username required") + return self.call_api_get("im.counters", roomId=room_id, username=user_name) + return self.call_api_get("im.counters", roomId=room_id) diff --git a/tests/test_ims.py b/tests/test_ims.py index dd3616b..b2e2d95 100644 --- a/tests/test_ims.py +++ b/tests/test_ims.py @@ -143,9 +143,7 @@ def test_im_counters(logged_rocket, recipient_user): assert im_counters.get("success") im_counters = logged_rocket.im_counters( + room_id=im_create.get("room").get("_id"), user_name=logged_rocket.me().json().get("_id") ).json() assert im_counters.get("success") - - with pytest.raises(RocketMissingParamException): - logged_rocket.im_counters() From 858709e06979ec406cadad37bf5fa8c837676aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Mon, 8 Aug 2022 20:20:00 +0200 Subject: [PATCH 05/21] Reformat with black --- tests/test_ims.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_ims.py b/tests/test_ims.py index b2e2d95..9d928d4 100644 --- a/tests/test_ims.py +++ b/tests/test_ims.py @@ -144,6 +144,6 @@ def test_im_counters(logged_rocket, recipient_user): im_counters = logged_rocket.im_counters( room_id=im_create.get("room").get("_id"), - user_name=logged_rocket.me().json().get("_id") + user_name=logged_rocket.me().json().get("_id"), ).json() assert im_counters.get("success") From 119bf7caf4564eae5b7797a6bf912d7f5cf4185e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Tue, 9 Aug 2022 15:36:02 +0200 Subject: [PATCH 06/21] Skip tests that got broken in 5.0 and have no simple fix or the fix is not on the API side --- tests/test_settings.py | 5 +++++ tests/test_video_conferences.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/tests/test_settings.py b/tests/test_settings.py index 6aaea9d..c6dcf80 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -1,5 +1,7 @@ import time +import pytest + def test_settings(logged_rocket): settings = logged_rocket.settings().json() @@ -19,6 +21,9 @@ def test_settings_public(rocket): assert "settings" in settings_public +@pytest.mark.skip( + reason="Broken in 5.0 https://github.com/jadolg/rocketchat_API/issues/168" +) def test_settings_oauth(logged_rocket): # refresh is not done with any API call ever, so we need to call it manually here response = logged_rocket.call_api_post( diff --git a/tests/test_video_conferences.py b/tests/test_video_conferences.py index 0b301e7..dd7d0bd 100644 --- a/tests/test_video_conferences.py +++ b/tests/test_video_conferences.py @@ -1,3 +1,9 @@ +import pytest + + +@pytest.mark.skip( + reason="Broken in 5.0. https://github.com/RocketChat/Rocket.Chat/issues/26520" +) def test_update_jitsi_timeout(logged_rocket): update_jitsi_timeout = logged_rocket.update_jitsi_timeout(room_id="GENERAL").json() assert update_jitsi_timeout.get("success") From c42ba68951a292732dee1d9ff1861ee7e9d8922a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 13:51:41 +0000 Subject: [PATCH 07/21] Bump requests from 2.25.1 to 2.28.1 Bumps [requests](https://github.com/psf/requests) from 2.25.1 to 2.28.1. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.25.1...v2.28.1) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9d84d35..d15ce5a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -requests==2.25.1 +requests==2.28.1 From 00e95f8c172dcf366fda78c33cb800ef03ff3102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Wed, 8 Jun 2022 09:42:04 +0200 Subject: [PATCH 08/21] Add rooms.export endpoint --- rocketchat_API/APISections/rooms.py | 6 ++++++ tests/test_rooms.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/rocketchat_API/APISections/rooms.py b/rocketchat_API/APISections/rooms.py index 27218ca..61bfd51 100644 --- a/rocketchat_API/APISections/rooms.py +++ b/rocketchat_API/APISections/rooms.py @@ -64,3 +64,9 @@ def rooms_create_discussion(self, prid, t_name, **kwargs): return self.call_api_post( "rooms.createDiscussion", prid=prid, t_name=t_name, kwargs=kwargs ) + + def rooms_export(self, rid, type, **kwargs): + """Export room to a file or email.""" + return self.call_api_post( + "rooms.export", rid=rid, type=type, kwargs=kwargs + ) \ No newline at end of file diff --git a/tests/test_rooms.py b/tests/test_rooms.py index 22d378b..daa3a63 100644 --- a/tests/test_rooms.py +++ b/tests/test_rooms.py @@ -92,3 +92,8 @@ def test_rooms_admin_rooms(logged_rocket): rooms_with_filter = logged_rocket.rooms_admin_rooms(**{"filter": "general"}).json() assert rooms_with_filter.get("success") assert rooms_with_filter.get("rooms")[0].get("_id") == "GENERAL" + + +def test_rooms_export(logged_rocket): + rooms_export = logged_rocket.rooms_export(rid="GENERAL", type="file").json() + assert rooms_export.get("success") From 57bb5d9e803b1e667336275dbd53411407946100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 12 Jun 2022 21:00:31 +0200 Subject: [PATCH 09/21] Add `format` parameter since it is required by the API but documented as Optional --- rocketchat_API/APISections/rooms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rocketchat_API/APISections/rooms.py b/rocketchat_API/APISections/rooms.py index 61bfd51..71fa987 100644 --- a/rocketchat_API/APISections/rooms.py +++ b/rocketchat_API/APISections/rooms.py @@ -65,8 +65,8 @@ def rooms_create_discussion(self, prid, t_name, **kwargs): "rooms.createDiscussion", prid=prid, t_name=t_name, kwargs=kwargs ) - def rooms_export(self, rid, type, **kwargs): + def rooms_export(self, rid, type, format="html", **kwargs): """Export room to a file or email.""" return self.call_api_post( - "rooms.export", rid=rid, type=type, kwargs=kwargs - ) \ No newline at end of file + "rooms.export", rid=rid, type=type, format=format, kwargs=kwargs + ) From aadde3835501ef20addd8b9fafa3c17a7e892d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 12 Jun 2022 21:16:30 +0200 Subject: [PATCH 10/21] Rename type and format so they don't collide with python's built-in names --- rocketchat_API/APISections/rooms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rocketchat_API/APISections/rooms.py b/rocketchat_API/APISections/rooms.py index 71fa987..d46bbfb 100644 --- a/rocketchat_API/APISections/rooms.py +++ b/rocketchat_API/APISections/rooms.py @@ -65,8 +65,8 @@ def rooms_create_discussion(self, prid, t_name, **kwargs): "rooms.createDiscussion", prid=prid, t_name=t_name, kwargs=kwargs ) - def rooms_export(self, rid, type, format="html", **kwargs): + def rooms_export(self, rid, atype, aformat="html", **kwargs): """Export room to a file or email.""" return self.call_api_post( - "rooms.export", rid=rid, type=type, format=format, kwargs=kwargs + "rooms.export", rid=rid, type=atype, format=aformat, kwargs=kwargs ) From e04cef85bb9b07e7aa3a856f66bbb135b1fbf6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 12 Jun 2022 21:20:57 +0200 Subject: [PATCH 11/21] Fix "line too long" issue --- rocketchat_API/APISections/rooms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rocketchat_API/APISections/rooms.py b/rocketchat_API/APISections/rooms.py index d46bbfb..f885206 100644 --- a/rocketchat_API/APISections/rooms.py +++ b/rocketchat_API/APISections/rooms.py @@ -58,9 +58,9 @@ def rooms_admin_rooms(self, **kwargs): return self.call_api_get("rooms.adminRooms", kwargs=kwargs) def rooms_create_discussion(self, prid, t_name, **kwargs): - """Creates a new discussion for room. It requires at least one of the following permissions: - start-discussion OR start-discussion-other-user, AND must be with the following setting enabled: - Discussion_enabled.""" + """Creates a new discussion for room. It requires at least one of the + following permissions: start-discussion OR start-discussion-other-user, + AND must be with the following setting enabled: Discussion_enabled.""" return self.call_api_post( "rooms.createDiscussion", prid=prid, t_name=t_name, kwargs=kwargs ) From 41704cc721ded9dd9db9c4e57f164e8658a86ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 12 Jun 2022 21:26:44 +0200 Subject: [PATCH 12/21] Remove TODO reason: Wont-Do --- tests/test_rooms.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_rooms.py b/tests/test_rooms.py index daa3a63..66bf398 100644 --- a/tests/test_rooms.py +++ b/tests/test_rooms.py @@ -4,8 +4,6 @@ def test_rooms_upload(logged_rocket): - # ToDo: Find a better way to test that this endpoint actually works fine (when using json and not data fails - # silently) rooms_upload = logged_rocket.rooms_upload( "GENERAL", file="tests/assets/avatar.png", description="hey there" ).json() From 4054056f968aef06310778eec4c53a61d139a601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 12 Jun 2022 21:29:38 +0200 Subject: [PATCH 13/21] Multiline docstrings with quotes in separate lines --- rocketchat_API/APISections/rooms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rocketchat_API/APISections/rooms.py b/rocketchat_API/APISections/rooms.py index f885206..8492f04 100644 --- a/rocketchat_API/APISections/rooms.py +++ b/rocketchat_API/APISections/rooms.py @@ -58,9 +58,11 @@ def rooms_admin_rooms(self, **kwargs): return self.call_api_get("rooms.adminRooms", kwargs=kwargs) def rooms_create_discussion(self, prid, t_name, **kwargs): - """Creates a new discussion for room. It requires at least one of the + """ + Creates a new discussion for room. It requires at least one of the following permissions: start-discussion OR start-discussion-other-user, - AND must be with the following setting enabled: Discussion_enabled.""" + AND must be with the following setting enabled: Discussion_enabled. + """ return self.call_api_post( "rooms.createDiscussion", prid=prid, t_name=t_name, kwargs=kwargs ) From 6644fb07c6c1c3c31ba621262987a41ad269f979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 12 Jun 2022 21:32:42 +0200 Subject: [PATCH 14/21] Fix parameter name on test --- tests/test_rooms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_rooms.py b/tests/test_rooms.py index 66bf398..c311ddf 100644 --- a/tests/test_rooms.py +++ b/tests/test_rooms.py @@ -93,5 +93,5 @@ def test_rooms_admin_rooms(logged_rocket): def test_rooms_export(logged_rocket): - rooms_export = logged_rocket.rooms_export(rid="GENERAL", type="file").json() + rooms_export = logged_rocket.rooms_export(rid="GENERAL", atype="file").json() assert rooms_export.get("success") From 1d1924f6bbb230b515299af7044ebacf557eb231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 12 Jun 2022 21:36:53 +0200 Subject: [PATCH 15/21] Sleep 5 seconds after rocket.chat server starts seems to be taking longer to start testing --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b10be69..36e7720 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - name: Lint with black run: black --check . - name: Wait for rocket.chat server to be online - run: until curl --silent http://localhost:3000/api/info/; do sleep 15; echo "waiting for Rocket.Chat server to start"; done + run: until curl --silent http://localhost:3000/api/info/; do sleep 15; echo "waiting for Rocket.Chat server to start"; done; sleep 5; - name: Run tests run: pytest tests rocketchat_API -x --cov-report xml --cov=./ - name: Upload code coverage From cfbd7c4f2adf2f6ceabe6f46c25123a0d1659942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 12 Jun 2022 21:42:17 +0200 Subject: [PATCH 16/21] Remove extra waiting time --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36e7720..0d8917a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - name: Lint with black run: black --check . - name: Wait for rocket.chat server to be online - run: until curl --silent http://localhost:3000/api/info/; do sleep 15; echo "waiting for Rocket.Chat server to start"; done; sleep 5; + run: until curl --silent http://localhost:3000/api/info/; do sleep 15; echo "waiting for Rocket.Chat server to start"; done; - name: Run tests run: pytest tests rocketchat_API -x --cov-report xml --cov=./ - name: Upload code coverage From e043fae2a19762c18fcbf8f5d41a18ed3a16475f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 12 Jun 2022 22:15:31 +0200 Subject: [PATCH 17/21] Remove old python versions from the test matrix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d8917a..baec67c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.6', '3.7', '3.8', '3.9' ] + python-version: [ '3.8', '3.9' ] steps: - name: Checkout uses: actions/checkout@v2.3.4 From f1fcfd77e0900348860389dd82c105f127738f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 12 Jun 2022 22:38:23 +0200 Subject: [PATCH 18/21] Always use the latest mongo version --- docker-compose-test-server.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose-test-server.yml b/docker-compose-test-server.yml index 49ec1f3..c708420 100644 --- a/docker-compose-test-server.yml +++ b/docker-compose-test-server.yml @@ -22,8 +22,6 @@ services: mongo: image: mongo - ports: - - "27017:27017" restart: unless-stopped command: mongod --oplogSize 128 --replSet rs0 From a08c63d0166c64d62f6ac961c6a1a56fce708bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Tue, 9 Aug 2022 16:13:50 +0200 Subject: [PATCH 19/21] Rename the docker-compose file to get rid of the annoyance of writing the file name all the time --- .github/workflows/build.yml | 2 +- README.md | 4 +++- docker-compose-test-server.yml => docker-compose.yml | 0 3 files changed, 4 insertions(+), 2 deletions(-) rename docker-compose-test-server.yml => docker-compose.yml (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index baec67c..63a088d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Start rocket.chat server uses: isbang/compose-action@v0.1.1 with: - compose-file: docker-compose-test-server.yml + compose-file: docker-compose.yml - name: Set up Python uses: actions/setup-python@v2 with: diff --git a/README.md b/README.md index d3795b7..2b989d8 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,9 @@ Most of the API methods are already implemented. If you are interested in a spec ### Tests We are actively testing :) -Tests run on a Rocket.Chat Docker container so install Docker and docker-compose. To start test server do `docker-compose -f docker-compose-test-server.yml up` and to take test server down `docker-compose -f docker-compose-test-server.yml down` +Tests run on a Rocket.Chat Docker container so install Docker and docker-compose. +1. To start test server do `docker-compose up` and to take test server down `docker-compose down` +2. To run the tests run `pytest` ### Contributing You can contribute by doing Pull Requests. (It may take a while to merge your code but if it's good it will be merged). Please, try to implement tests for all your code and use a PEP8 compliant code style. diff --git a/docker-compose-test-server.yml b/docker-compose.yml similarity index 100% rename from docker-compose-test-server.yml rename to docker-compose.yml From 9f7829326c8eb579bb9c87208ffdf9ba6064ea67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Tue, 9 Aug 2022 19:14:53 +0200 Subject: [PATCH 20/21] Revert "Add rooms.export endpoint" This reverts commit 00e95f8c --- rocketchat_API/APISections/rooms.py | 6 ------ tests/test_rooms.py | 5 ----- 2 files changed, 11 deletions(-) diff --git a/rocketchat_API/APISections/rooms.py b/rocketchat_API/APISections/rooms.py index 8492f04..3301b85 100644 --- a/rocketchat_API/APISections/rooms.py +++ b/rocketchat_API/APISections/rooms.py @@ -66,9 +66,3 @@ def rooms_create_discussion(self, prid, t_name, **kwargs): return self.call_api_post( "rooms.createDiscussion", prid=prid, t_name=t_name, kwargs=kwargs ) - - def rooms_export(self, rid, atype, aformat="html", **kwargs): - """Export room to a file or email.""" - return self.call_api_post( - "rooms.export", rid=rid, type=atype, format=aformat, kwargs=kwargs - ) diff --git a/tests/test_rooms.py b/tests/test_rooms.py index c311ddf..9b7c5b1 100644 --- a/tests/test_rooms.py +++ b/tests/test_rooms.py @@ -90,8 +90,3 @@ def test_rooms_admin_rooms(logged_rocket): rooms_with_filter = logged_rocket.rooms_admin_rooms(**{"filter": "general"}).json() assert rooms_with_filter.get("success") assert rooms_with_filter.get("rooms")[0].get("_id") == "GENERAL" - - -def test_rooms_export(logged_rocket): - rooms_export = logged_rocket.rooms_export(rid="GENERAL", atype="file").json() - assert rooms_export.get("success") From 7901aabb90c8a9eab86c40452ffbc84d76f256e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Tue, 9 Aug 2022 19:19:20 +0200 Subject: [PATCH 21/21] Add python 3.10 to the test matrix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63a088d..555f017 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8', '3.9' ] + python-version: [ '3.8', '3.9', '3.10' ] steps: - name: Checkout uses: actions/checkout@v2.3.4