X-Git-Url: https://mudpy.org/gitweb?a=blobdiff_plain;f=bin%2Ftest;h=0ec35440d72e0d48c61588e3b1b353fafa758da1;hb=015ea384dafbc17070d3c11e84004ca27b866eb9;hp=9dec9f47290e9d039b8e98ba735e05a71468827e;hpb=2b715343d6c3732a6e8468358e0cf29ede8d4fde;p=mudpy.git diff --git a/bin/test b/bin/test index 9dec9f4..0ec3544 100755 --- a/bin/test +++ b/bin/test @@ -2,10 +2,12 @@ # -*- coding: utf-8 -*- """Regression test script for the mudpy engine.""" -# Copyright (c) 2004-2011 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"), @@ -24,10 +26,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()