Skip to content

Commit

Permalink
Ошибка при использовании get_all для метода socialnetwork.api.workgro…
Browse files Browse the repository at this point in the history
…up.list (#222)
  • Loading branch information
leshchenko1979 authored Mar 18, 2024
1 parent 4a450b3 commit 49b5d92
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
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

0 comments on commit 49b5d92

Please sign in to comment.