X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=mudpy%2Ftests%2Fselftest.py;h=d5b8ac4d6712459f2aa4d2cdb4300eefbb5ae4fe;hp=b1eb7cff93f18504608783ecf250c0bbb51f2915;hb=b27c62e7d11d4c221666e7e0241a8ea51902be88;hpb=4952650f4d863af5214d05dc1bca896800d9baa6 diff --git a/mudpy/tests/selftest.py b/mudpy/tests/selftest.py index b1eb7cf..d5b8ac4 100644 --- a/mudpy/tests/selftest.py +++ b/mudpy/tests/selftest.py @@ -11,6 +11,13 @@ import sys import telnetlib import time +# TODO(fungi) Clean this up once Python 3.5 is no longer supported +if sys.version < "3.6": + import collections + odict = collections.OrderedDict +else: + odict = dict + pidfile = "var/mudpy.pid" test_account0_setup = ( @@ -378,7 +385,7 @@ final_cleanup = ( (2, r"Disconnecting\.\.\.", ""), ) -dialogue = ( +dialogue = odict(( (test_account0_setup, "first account setup"), (test_account1_setup, "second account setup"), (test_actor_appears, "actor spontaneous appearance"), @@ -423,7 +430,7 @@ dialogue = ( (test_invalid_loglevel, "invalid loglevel"), (test_log_no_errors, "no errors logged"), (final_cleanup, "delete remaining accounts"), -) +)) def start_service(config): @@ -534,7 +541,8 @@ def main(): for luser in lusers: luser.open("::1", 4000) luser.set_option_negotiation_callback(option_callback) - for test, description in dialogue: + selected_dialogue = odict(dialogue) + for test, description in selected_dialogue.items(): tlog("\nTesting %s..." % description) test_start = time.time() for conversant, question, answer in test: