X-Git-Url: https://mudpy.org/gitweb?a=blobdiff_plain;f=bin%2Ftest;h=22dce68fee20fb2d150929e34a0a0ea77d6e128c;hb=7e78772b5ba2efbb84710db0ecd540c9b745217a;hp=9dec9f47290e9d039b8e98ba735e05a71468827e;hpb=2b715343d6c3732a6e8468358e0cf29ede8d4fde;p=mudpy.git diff --git a/bin/test b/bin/test index 9dec9f4..22dce68 100755 --- a/bin/test +++ b/bin/test @@ -1,18 +1,19 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- """Regression test script for the mudpy engine.""" -# Copyright (c) 2004-2011 Jeremy Stanley . Permission +# Copyright (c) 2004-2015 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"), + ("Pick a birth 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?", ""), @@ -24,10 +25,9 @@ conversation = ( ("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.read_until(("%s " % question).encode("utf-8")) + mud.write(("%s\r\n" % answer).encode("utf-8")) mud.close()