From dc551bdf3ef23e8b729ab4841373d542662ced30 Mon Sep 17 00:00:00 2001 From: Alexey Leshchenko Date: Mon, 18 Mar 2024 18:20:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B8=20get=5Fall=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=20socialnetwork.api.wor?= =?UTF-8?q?kgroup.list=20Fixes=20#207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../socialnetwork_api_workgroup_list.py | 68 +++++++++++++++++++ tests/test_server_responses.py | 28 ++++++++ 2 files changed, 96 insertions(+) create mode 100644 tests/real_responses/socialnetwork_api_workgroup_list.py diff --git a/tests/real_responses/socialnetwork_api_workgroup_list.py b/tests/real_responses/socialnetwork_api_workgroup_list.py new file mode 100644 index 0000000..b8c9020 --- /dev/null +++ b/tests/real_responses/socialnetwork_api_workgroup_list.py @@ -0,0 +1,68 @@ +response = { + "result": { + "workgroups": [ + {"id": "8"}, + {"id": "10"}, + {"id": "12"}, + {"id": "14"}, + {"id": "16"}, + {"id": "18"}, + {"id": "20"}, + {"id": "22"}, + {"id": "24"}, + {"id": "26"}, + {"id": "28"}, + {"id": "30"}, + {"id": "32"}, + {"id": "34"}, + {"id": "36"}, + {"id": "38"}, + {"id": "40"}, + {"id": "42"}, + {"id": "44"}, + {"id": "46"}, + {"id": "48"}, + {"id": "50"}, + {"id": "52"}, + {"id": "54"}, + {"id": "58"}, + {"id": "60"}, + {"id": "62"}, + {"id": "64"}, + {"id": "66"}, + {"id": "68"}, + {"id": "70"}, + {"id": "72"}, + {"id": "73"}, + {"id": "74"}, + {"id": "76"}, + {"id": "78"}, + {"id": "80"}, + {"id": "82"}, + {"id": "83"}, + {"id": "85"}, + {"id": "87"}, + {"id": "89"}, + {"id": "91"}, + {"id": "93"}, + {"id": "95"}, + {"id": "97"}, + {"id": "99"}, + {"id": "101"}, + {"id": "103"}, + {"id": "105"}, + ] + }, + "next": 50, + "total": 50, + "time": { + "start": 1667156327.84961, + "finish": 1667156327.884964, + "duration": 0.035353899002075195, + "processing": 0.010620832443237305, + "date_start": "2022-10-30T21:58:47+03:00", + "date_finish": "2022-10-30T21:58:47+03:00", + "operating_reset_at": 1667156927, + "operating": 0, + }, +} diff --git a/tests/test_server_responses.py b/tests/test_server_responses.py index 4fc0f06..c13c368 100644 --- a/tests/test_server_responses.py +++ b/tests/test_server_responses.py @@ -210,3 +210,31 @@ def test_crm_stagehistory_list(bx_dummy): results = bx_dummy.get_all("crm.stagehistory.list") assert len(results) == 9 + + +def test_socialnetwork_api_workgroup_list(bx_dummy): + from tests.real_responses.socialnetwork_api_workgroup_list import response + + bx_dummy.srh = MockSRH(response) + results = bx_dummy.get_all( + "socialnetwork.api.workgroup.list", + { + "select": [ + "ID", + "NAME", + "DESCRIPTION", + "DATE_CREATE", + "DATE_UPDATE", + "DATE_ACTIVITY", + "SUBJECT_ID", + "KEYWORDS", + "IMAGE_ID", + "NUMBER_OF_MEMBERS", + "INITIATE_PERMS", + "SPAM_PERMS", + "SUBJECT_NAME", + ] + }, + ) + + assert len(results) == 50