Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ошибка при использовании get_all для метода socialnetwork.api.workgroup.list #222

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions tests/real_responses/socialnetwork_api_workgroup_list.py
Original file line number Diff line number Diff line change
@@ -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,
},
}
28 changes: 28 additions & 0 deletions tests/test_server_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading