capturemock recording badly quoted '''null''' that it can't replay

Bug #1291399 reported by Emily Bache
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CaptureMock
Fix Released
Undecided
Unassigned

Bug Description

Capturemock is recording something it can't then replay. It records:

<-PYT:subprocess.Popen(['twiddle.sh', '-s', 'localhost:1099', 'invoke', 'jboss.system:type=Server', 'shutdown'], stderr=-2, stdout=-1)
->RET:Instance('Popen(object)', 'popen2')
<-PYT:popen2.communicate()
->RET:("'''null'
"'', None)
<-PYT:popen2.returncode
->RET:0

which causes this stacktrace when it tries to replay it:

File "/usr/local/lib/python2.7/dist-packages/capturemock/pythonclient.py", line 102, in __call__
    *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/capturemock/pythontraffic.py", line 391, in callFunction
    return self.processReplay(traffic, captureMockProxy, traffic.shouldRecord)
  File "/usr/local/lib/python2.7/dist-packages/capturemock/pythontraffic.py", line 290, in processReplay
    return proxy.captureMockEvaluate(responseText)
  File "/usr/local/lib/python2.7/dist-packages/capturemock/pythonclient.py", line 96, in captureMockEvaluate
    return eval(response, self.captureMockNameFinder)
  File "<string>", line 1
    ("'''null'
             ^
SyntaxError: EOL while scanning string literal

If I manually edit the recorded string to read:

<-PYT:subprocess.Popen(['/home/emilyb/tools/jboss/jboss-4.2.1GA/bin/twiddle.sh', '-s', 'localhost:1099', 'invoke', 'jboss.system:type=Server', 'shutdown'], stderr=-2, stdout=-1)
->RET:Instance('Popen(object)', 'popen2')
<-PYT:popen2.communicate()
->RET:("'''null'''", None)
<-PYT:popen2.returncode
->RET:0

Then it works fine to replay it.

If I run this command on the command line, the output the program actually produces looks like this:

$ > /home/emilyb/tools/jboss/jboss-4.2.1GA/bin/twiddle.sh -s localhost:1099 invoke jboss.system:type=Server shutdown
'null'

$ >

(followed by a newline)

Revision history for this message
Geoff Bache (geoff.bache) wrote :

Checked in a fix. Problem was multiline string starting with a single quote.

Changed in capturemock:
status: New → Fix Committed
Changed in capturemock:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.