From: Jeremy Stanley Date: Wed, 15 Jul 2015 20:54:53 +0000 (+0000) Subject: Read pending bytes before proceeding with test X-Git-Tag: 0.0.1~212 X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=commitdiff_plain;h=b227518cf9c171e1e355e42b19fe8ecc70e377f6;hp=74542e2249c308c6c40aef50eaf227b46fd1bc9d Read pending bytes before proceeding with test After a match in found in each step of the functional test, read in the remaining buffer before replying. This makes the captures slightly more readable, especially if the match in early in a block of output. --- diff --git a/bin/test b/bin/test index 35b2a99..e9665ec 100755 --- a/bin/test +++ b/bin/test @@ -85,6 +85,11 @@ for conversant, question, answer in dialogue: index, match, received = lusers[conversant].expect( [question.encode("utf-8")], 5) captures[conversant] += received.decode("utf-8") + try: + captures[conversant] += lusers[ + conversant].read_very_eager().decode("utf-8") + except: + pass if index is not 0: print("ERROR: luser%s did not receive expected string:\n\n%s" % (conversant, question))