To avoid any further unnecessary notifications with actions taken to remedy the prior pull request I just created a new branch and properly pointed to dev as its upstream branch then applied changes too it. Afterwards I tested the functionally again and ran the unit tests again with working results.
Again, sorry for the confusion.
Implements
leaderboard() function in game_commands.py
create_leaderboard() method in core.py
test_game_rejects_invalid_leaderboard_length() in test_game.py
test_game_rejects_invalid_leaderboard_sorting() in test_game.py
test_game_produces_valid_leaderboard() in test_game.py
test_request_leaderboard_no_register() in test_game_commands.py
test_request_leaderboard_no_game() in test_game_commands.py
The default values for the leaderboard command are 'debt' and 5 therefore sending a bot message with the top 5 users based on debt, but users can input cranes and any other length.
Targets Issue Leaderboard command #5
To avoid any further unnecessary notifications with actions taken to remedy the prior pull request I just created a new branch and properly pointed to dev as its upstream branch then applied changes too it. Afterwards I tested the functionally again and ran the unit tests again with working results.
Again, sorry for the confusion.
Implements
leaderboard()
function ingame_commands.py
create_leaderboard()
method incore.py
test_game_rejects_invalid_leaderboard_length()
intest_game.py
test_game_rejects_invalid_leaderboard_sorting()
intest_game.py
test_game_produces_valid_leaderboard()
intest_game.py
test_request_leaderboard_no_register()
intest_game_commands.py
test_request_leaderboard_no_game()
intest_game_commands.py
The default values for the leaderboard command are 'debt' and 5 therefore sending a bot message with the top 5 users based on debt, but users can input cranes and any other length.
Achieved functionality:
Though with this solution it requires the user to enter a sorting type if they wish to enter a leaderboard length requirement.
Unit Tests
test_game.py
test_game_rejects_invalid_leaderboard_length()
Checks proper rejection of a requested leaderboard length < 1.test_game_rejects_invalid_leaderboard_sorting()
Checks proper rejection of an invalid sorting key, ie != "debt" or "cranes".test_game_produces_valid_leaderboard()
Checks proper leaderboard layout given 1 player and test values.test_game_commands_cog.py
test_request_leaderboard_no_register()
Checks command properly informs users if no one has registered and a leaderboard cannot be made.test_request_leaderboard_no_game()
Checks command properly informs users when the game has not been properly loaded.-Greg