From: Jeremy Stanley Date: Thu, 26 Dec 2019 01:57:24 +0000 (+0000) Subject: More thoroughly test account and avatar menus X-Git-Tag: 0.1.0~20 X-Git-Url: https://mudpy.org/gitweb?a=commitdiff_plain;h=3664932805146a7eb7a6d7dc57ecb1fd8ca9045b;p=mudpy.git More thoroughly test account and avatar menus Split up the teardown "test" into separate tests for avatar and account deletion. Avatar deletion was previously not being exercised correctly, instead avatar deletion aborting was what was actually being tested. Add separate tests that the avatar and account deletion default actions are to abort. Also add a test of the avatar creation limit. --- diff --git a/mudpy/tests/selftest.py b/mudpy/tests/selftest.py index 86ffe22..d9a6ee0 100644 --- a/mudpy/tests/selftest.py +++ b/mudpy/tests/selftest.py @@ -143,9 +143,48 @@ test_actor_disappears = ( (0, r"You suddenly wonder where .* went\.", ""), ) -test_account1_teardown = ( +test_abort_avatar_deletion = ( (1, r"What would you like to do\?", "d"), (1, r"Whom would you like to delete\?", ""), + (1, r"delete an unwanted avatar.*What would you like to do\?", ""), +) + +test_avatar_creation_limit = ( + (1, r"What would you like to do\?", "c"), + (1, "Pick a birth gender for your new avatar:", "m"), + (1, "Choose a name for him:", "3"), + (1, r"What would you like to do\?", "c"), + (1, "Pick a birth gender for your new avatar:", "m"), + (1, "Choose a name for him:", "4"), + (1, r"What would you like to do\?", "c"), + (1, "Pick a birth gender for your new avatar:", "m"), + (1, "Choose a name for him:", "7"), + (1, r"What would you like to do\?", "c"), + (1, "Pick a birth gender for your new avatar:", "m"), + (1, "Choose a name for him:", "5"), + (1, r"What would you like to do\?", "c"), + (1, "Pick a birth gender for your new avatar:", "m"), + (1, "Choose a name for him:", "2"), + (1, r"What would you like to do\?", "c"), + (1, "Pick a birth gender for your new avatar:", "m"), + (1, "Choose a name for him:", "6"), + (1, r"What would you like to do\?", "c"), + (1, r"That is not a valid choice\.\.\.", ""), +) + +test_avatar_deletion = ( + (1, r"What would you like to do\?", "d"), + (1, r"Whom would you like to delete\?", "1"), + (1, r"create a new avatar.*What would you like to do\?", ""), +) + +test_abort_account_deletion = ( + (1, r"What would you like to do\?", "p"), + (1, r"permanently delete your account\?", ""), + (1, r"What would you like to do\?", ""), +) + +test_account_deletion = ( (1, r"What would you like to do\?", "p"), (1, r"permanently delete your account\?", "y"), (1, r"Disconnecting\.\.\.", ""), @@ -330,14 +369,10 @@ test_log_no_errors = ( final_cleanup = ( (0, "> ", "quit"), - (0, r"What would you like to do\?", "d"), - (0, r"Whom would you like to delete\?", ""), (0, r"What would you like to do\?", "p"), (0, r"permanently delete your account\?", "y"), (0, r"Disconnecting\.\.\.", ""), (2, "> ", "quit"), - (2, r"What would you like to do\?", "d"), - (2, r"Whom would you like to delete\?", ""), (2, r"What would you like to do\?", "p"), (2, r"permanently delete your account\?", "y"), (2, r"Disconnecting\.\.\.", ""), @@ -357,7 +392,11 @@ dialogue = ( (test_escape_macros, "replacement macros are escaped"), (test_movement, "movement"), (test_actor_disappears, "actor spontaneous disappearance"), - (test_account1_teardown, "second account teardown"), + (test_abort_avatar_deletion, "abort avatar deletion"), + (test_avatar_creation_limit, "avatar creation limit"), + (test_avatar_deletion, "avatar deletion"), + (test_abort_account_deletion, "abort account deletion"), + (test_account_deletion, "account deletion"), (test_admin_setup, "admin account setup"), (test_preferences, "set and show preferences"), (test_crlf_eol, "send crlf from the client as eol"),