From a3c83c8d54917bc57f58880437bf4d3dc6f02197 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Wed, 15 Jul 2015 20:54:53 +0000 Subject: [PATCH] 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. --- bin/test | 5 +++++ 1 file changed, 5 insertions(+) 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)) -- 2.11.0