Python backend for a Slack's kudos plugin.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: unit test split_users_in_groups

+29
+7
.fleet/run.json
··· 50 50 "testFramework": "pytest", 51 51 "target": "kefi/tests/test_interactivity", 52 52 "arguments": [] 53 + }, 54 + { 55 + "type": "python-tests", 56 + "name": "Run plazas tests", 57 + "testFramework": "pytest", 58 + "target": "kefi/tests/plazas/helpers", 59 + "arguments": [] 53 60 } 54 61 ] 55 62 }
kefi/tests/plazas/__init__.py

This is a binary file and will not be displayed.

+22
kefi/tests/plazas/helpers.py
··· 1 + from kefi.models.plazas.helpers import split_users_in_groups 2 + from kefi.models.database import User 3 + 4 + 5 + def test_split_users_in_groups(): 6 + mock_user_list = lambda size_list: ( 7 + User(slack_user_id="user_1") for i in range(size_list) 8 + ) 9 + # Creates some list of users 10 + # Here i would like to mock settings value to [3,4,5] for test to work always 11 + # Creates some list of users 12 + users_lists = [ 13 + {"list": mock_user_list(9), "expected_groups": 3}, 14 + {"list": mock_user_list(10), "expected_groups": 2}, 15 + {"list": mock_user_list(8), "expected_groups": 2}, 16 + {"list": mock_user_list(14), "expected_groups": 4}, 17 + {"list": mock_user_list(3), "expected_groups": 1}, 18 + {"list": mock_user_list(2), "expected_groups": 0}, 19 + ] 20 + 21 + for users in users_lists: 22 + assert len(split_users_in_groups(users.list)) == users.expected_groups