X-Git-Url: https://mudpy.org/gitweb?a=blobdiff_plain;f=bin%2Ftest;h=0ec35440d72e0d48c61588e3b1b353fafa758da1;hb=64fe72be53ff7a16d2b715d379b604fcfa574fd8;hp=8e5939bbec919149c3006f2c1d406bcfbd1c7832;hpb=3a6185cccba6b7af5725d2767d0c57de05f9fac5;p=mudpy.git diff --git a/bin/test b/bin/test index 8e5939b..0ec3544 100755 --- a/bin/test +++ b/bin/test @@ -1,33 +1,34 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -u"""Regression test script for the mudpy engine.""" +"""Regression test script for the mudpy engine.""" -# Copyright (c) 2004-2010 Jeremy Stanley . Permission +# Copyright (c) 2004-2013 Jeremy Stanley . Permission # to use, copy, modify, and distribute this software is granted under # terms provided in the LICENSE file distributed with this software. +import telnetlib + conversation = ( - ( "Identify yourself:" , "testuser" ), - ( "Enter your choice:" , "n" ), - ( "Enter a new password for \"testuser\":" , "Test123" ), - ( "Enter the same new password again:" , "Test123" ), - ( "What would you like to do?" , "c" ), - ( "Pick a gender for your new avatar:" , "f" ), - ( "Choose a name for her:" , "1" ), - ( "What would you like to do?" , "a" ), - ( "Whom would you like to awaken?" , "" ), - ( ">" , "quit" ), - ( "What would you like to do?" , "d" ), - ( "Whom would you like to delete?" , "" ), - ( "What would you like to do?" , "p" ), - ( "permanently delete your account?" , "y" ), - ( "Disconnecting..." , "" ), + ("Identify yourself:", "testuser"), + ("Enter your choice:", "n"), + ("Enter a new password for \"testuser\":", "Test123"), + ("Enter the same new password again:", "Test123"), + ("What would you like to do?", "c"), + ("Pick a gender for your new avatar:", "f"), + ("Choose a name for her:", "1"), + ("What would you like to do?", "a"), + ("Whom would you like to awaken?", ""), + (">", "quit"), + ("What would you like to do?", "d"), + ("Whom would you like to delete?", ""), + ("What would you like to do?", "p"), + ("permanently delete your account?", "y"), + ("Disconnecting...", ""), ) -import telnetlib mud = telnetlib.Telnet() -mud.open("::1",6669) -for question,answer in conversation: - mud.read_until("%s " % question) - mud.write("%s\r\n" % answer) +mud.open("::1", 6669) +for question, answer in conversation: + mud.read_until(("%s " % question).encode("utf-8")) + mud.write(("%s\r\n" % answer).encode("utf-8")) mud.close()