From 25994af3127b2ec26bcbf37ae481bdd04f580fe4 Mon Sep 17 00:00:00 2001 From: Leon Zhang Date: Mon, 22 Jan 2024 22:00:30 -0500 Subject: [PATCH] Update available positions in configuration files, pertaining to issue #63 (#117) Updated available positions adding new positions and removing 2 unused positions in ceo. Passed Drone CI. Co-authored-by: Leon Reviewed-on: https://git.csclub.uwaterloo.ca/public/pyceo/pulls/117 Reviewed-by: Max Erenberg --- ceo/tui/views/position_names.py | 10 ++++++-- etc/ceo.ini | 7 ++++-- etc/ceod.ini | 6 +++-- tests/ceo/cli/test_positions.py | 40 +++++++++++++++++++++----------- tests/ceo_dev.ini | 6 +++-- tests/ceod/api/test_positions.py | 22 ++++++++++++++++++ tests/ceod_dev.ini | 6 +++-- tests/ceod_test_local.ini | 6 +++-- 8 files changed, 78 insertions(+), 25 deletions(-) diff --git a/ceo/tui/views/position_names.py b/ceo/tui/views/position_names.py index 96b391d..29896d2 100644 --- a/ceo/tui/views/position_names.py +++ b/ceo/tui/views/position_names.py @@ -5,8 +5,14 @@ position_names = { 'secretary': "Secretary", 'sysadmin': "Sysadmin", 'cro': "Chief Returning Officer", - 'librarian': "Librarian", - 'imapd': "IMAPD", 'webmaster': "Web Master", 'offsck': "Office Manager", + 'ext-affairs-lead': "External Affairs Lead", + 'marketing-lead': "Marketing Lead", + 'design-lead': "Design Lead", + 'reps-lead': "Reps Lead", + 'mods-lead': "Mods Lead", + 'photography-lead': "Photography Lead", + 'codey-bot-lead': 'Codey Bot Lead', + 'other': 'Other', } diff --git a/etc/ceo.ini b/etc/ceo.ini index c3a5e95..5365133 100644 --- a/etc/ceo.ini +++ b/etc/ceo.ini @@ -18,8 +18,11 @@ port = 9987 [positions] required = president,vice-president,sysadmin -available = president,vice-president,treasurer,secretary, - sysadmin,cro,librarian,imapd,webmaster,offsck +available = president,vice-president,sysadmin,treasurer, + secretary,cro,webmaster,offsck,ext-affairs-lead, + marketing-lead,design-lead,events-lead,reps-lead, + mods-lead,photography-lead,codey-bot-lead,other + [mysql] host = caffeine diff --git a/etc/ceod.ini b/etc/ceod.ini index d5b337c..f378477 100644 --- a/etc/ceod.ini +++ b/etc/ceod.ini @@ -63,8 +63,10 @@ exec = exec,exec-moderators [positions] required = president,vice-president,sysadmin -available = president,vice-president,treasurer,secretary, - sysadmin,cro,librarian,imapd,webmaster,offsck +available = president,vice-president,sysadmin,treasurer, + secretary,cro,webmaster,offsck,ext-affairs-lead, + marketing-lead,design-lead,events-lead,reps-lead, + mods-lead,photography-lead,codey-bot-lead,other [mysql] # This is only used on the database_host. diff --git a/tests/ceo/cli/test_positions.py b/tests/ceo/cli/test_positions.py index dee7d9d..3c8eaed 100644 --- a/tests/ceo/cli/test_positions.py +++ b/tests/ceo/cli/test_positions.py @@ -39,16 +39,23 @@ def test_positions(cli_setup, g_admin_ctx): assert result.exit_code == 0 assert result.output == ''' The positions will be updated: -president: test_0 -vice-president: test_1 -sysadmin: test_2 -secretary: test_3 -webmaster: test_4 +president: test_0 +vice-president: test_1 +sysadmin: test_2 +secretary: test_3 +webmaster: test_4 treasurer: cro: -librarian: -imapd: offsck: +ext-affairs-lead: +marketing-lead: +design-lead: +events-lead: +reps-lead: +mods-lead: +photography-lead: +codey-bot-lead: +other: Do you want to continue? [y/N]: y Update positions in LDAP... Done Update executive group in LDAP... Done @@ -108,16 +115,23 @@ def test_positions_multiple_users(cli_setup, g_admin_ctx): assert result.exit_code == 0 assert result.output == ''' The positions will be updated: -president: test_0 -vice-president: test_1, test_2 -sysadmin: test_2 -secretary: test_3, test_4, test_2 +president: test_0 +vice-president: test_1, test_2 +sysadmin: test_2 +secretary: test_3, test_4, test_2 treasurer: cro: -librarian: -imapd: webmaster: offsck: +ext-affairs-lead: +marketing-lead: +design-lead: +events-lead: +reps-lead: +mods-lead: +photography-lead: +codey-bot-lead: +other: Do you want to continue? [y/N]: y Update positions in LDAP... Done Update executive group in LDAP... Done diff --git a/tests/ceo_dev.ini b/tests/ceo_dev.ini index 12ad1e3..ef63b5b 100644 --- a/tests/ceo_dev.ini +++ b/tests/ceo_dev.ini @@ -14,8 +14,10 @@ port = 9987 [positions] required = president,vice-president,sysadmin -available = president,vice-president,treasurer,secretary, - sysadmin,cro,librarian,imapd,webmaster,offsck +available = president,vice-president,sysadmin,treasurer, + secretary,cro,webmaster,offsck,ext-affairs-lead, + marketing-lead,design-lead,events-lead,reps-lead, + mods-lead,photography-lead,codey-bot-lead,other [mysql] host = coffee diff --git a/tests/ceod/api/test_positions.py b/tests/ceod/api/test_positions.py index 6e1cfbc..a4309f9 100644 --- a/tests/ceod/api/test_positions.py +++ b/tests/ceod/api/test_positions.py @@ -99,6 +99,28 @@ def test_set_positions(cfg, client, g_admin_ctx, mock_mailman_server): 'vice-president': ['test2', 'test3'], 'sysadmin': ['test2', 'test3', 'test4'], }} + # check every single psition + status, data = client.post('/api/positions', json={ + 'president': 'test1', + 'vice-president': 'test1', + 'treasurer': 'test1', + 'secretary': 'test1', + 'sysadmin': 'test1', + 'cro': 'test1', + 'webmaster': 'test1', + 'offsck': 'test1', + 'ext-affairs-lead': 'test1', + 'marketing-lead': 'test1', + 'design-lead': 'test1', + 'events-lead': 'test1', + 'reps-lead': 'test1', + 'mods-lead': 'test1', + 'photography-lead': 'test1', + 'codey-bot-lead': 'test1', + 'other': 'test1', + }) + assert status == 200 + assert data[-1]['status'] == 'completed' finally: with g_admin_ctx(): for user in users: diff --git a/tests/ceod_dev.ini b/tests/ceod_dev.ini index 172744a..bf529b5 100644 --- a/tests/ceod_dev.ini +++ b/tests/ceod_dev.ini @@ -59,8 +59,10 @@ exec = exec [positions] required = president,vice-president,sysadmin -available = president,vice-president,treasurer,secretary, - sysadmin,cro,librarian,imapd,webmaster,offsck +available = president,vice-president,sysadmin,treasurer, + secretary,cro,webmaster,offsck,ext-affairs-lead, + marketing-lead,design-lead,events-lead,reps-lead, + mods-lead,photography-lead,codey-bot-lead,other [mysql] username = mysql diff --git a/tests/ceod_test_local.ini b/tests/ceod_test_local.ini index fb1c415..f6e84da 100644 --- a/tests/ceod_test_local.ini +++ b/tests/ceod_test_local.ini @@ -58,8 +58,10 @@ exec = exec [positions] required = president,vice-president,sysadmin -available = president,vice-president,treasurer,secretary, - sysadmin,cro,librarian,imapd,webmaster,offsck +available = president,vice-president,sysadmin,treasurer, + secretary,cro,webmaster,offsck,ext-affairs-lead, + marketing-lead,design-lead,events-lead,reps-lead, + mods-lead,photography-lead,codey-bot-lead,other [mysql] username = mysql