I have a robot framework file where I am calling a python function and passing it an argument. I want to pass the argument to python as a Unicode, but it keeps getting passed as the string.
Function is
def assert_my_test( var1, var3=[]):
print "var1" #this i want in unicode, unicode(var1) doesnt help
f=gzip.open("myfile.gzip")
lines=f.readlines()
if any(unicode(var1) in unicode(s) for s in lines):
print "found our line"
Robot is
======================== ===================== =======================
Test Case Action Argument
======================== ===================== =======================
test1 myprog.assert_my_test \x01\x02\x03
Output is x01x02x03 instead of u"x01x02x03"
Any ideas how to pass Unicode properly? Really appreciated.
I have tried passing "Unicode(var1) to the function definition but that results in an error.
Complete variable i am trying to pass is -
\x01\x02\x03html&h=250&slotname5&adk=1204670.0&url=htt||1|0Ft2qy|4CX000||||17.022qy^A0C5vZBmjiK^ABusiness^DPersonalFin-0^A^A^Afalse^Afalse^A^A^A^A^A^A^A^A^A0^A0^A0^A0^A^A^A1^A^A^A^A1^A^A^A^A6284035007053575^A^A^Aen^A^Ab1cc^A^A8281671^Aalias_type^DDX^Calias_id^D4CXDxrs315^C"
I want to find if this variable exists in the file.