3 new revisions:
Revision: 7ae3196f10ee
Author: Mikko Korpela <[email protected]>
Date: Sun Jun 5 10:59:39 2011
Log: test text existance before encode
http://code.google.com/p/robotframework/source/detail?r=7ae3196f10ee
Revision: 409e9a42aa6d
Author: Mikko Korpela <[email protected]>
Date: Wed Jun 8 02:49:11 2011
Log: Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=409e9a42aa6d
Revision: 604d6b6b52e9
Author: Mikko Korpela <[email protected]>
Date: Wed Jun 8 02:54:43 2011
Log: jsserializer: do not add empty message to status also fix unit
tests
http://code.google.com/p/robotframework/source/detail?r=604d6b6b52e9
==============================================================================
Revision: 7ae3196f10ee
Author: Mikko Korpela <[email protected]>
Date: Sun Jun 5 10:59:39 2011
Log: test text existance before encode
http://code.google.com/p/robotframework/source/detail?r=7ae3196f10ee
Modified:
/src/robot/serializing/jsparser.py
=======================================
--- /src/robot/serializing/jsparser.py Sun Jun 5 10:06:49 2011
+++ /src/robot/serializing/jsparser.py Sun Jun 5 10:59:39 2011
@@ -134,6 +134,9 @@
def add(self, text):
if not text:
return 0
+ raw = self._raw(text)
+ if raw in self.texts:
+ return self.texts[raw]
text = self._encode(text)
if text not in self.texts:
self.texts[text] = self.index
@@ -142,9 +145,12 @@
def _encode(self, text):
encoded = base64.b64encode(zlib.compress(text.encode('utf-8'), 9))
- raw = '*'+text
+ raw = self._raw(text)
return encoded if len(encoded) < len(raw) else raw
+ def _raw(self, text):
+ return '*'+text
+
def dump(self):
l = range(len(self.texts)+1)
l[0] = '*'
==============================================================================
Revision: 409e9a42aa6d
Author: Mikko Korpela <[email protected]>
Date: Wed Jun 8 02:49:11 2011
Log: Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=409e9a42aa6d
Modified:
/src/robot/serializing/jsparser.py
=======================================
--- /src/robot/serializing/jsparser.py Tue Jun 7 07:42:34 2011
+++ /src/robot/serializing/jsparser.py Wed Jun 8 02:49:11 2011
@@ -133,6 +133,9 @@
def add(self, text):
if not text:
return 0
+ raw = self._raw(text)
+ if raw in self.texts:
+ return self.texts[raw]
text = self._encode(text)
if text not in self.texts:
self.texts[text] = self.index
@@ -141,9 +144,12 @@
def _encode(self, text):
encoded = base64.b64encode(zlib.compress(text.encode('utf-8'), 9))
- raw = '*'+text
+ raw = self._raw(text)
return encoded if len(encoded) < len(raw) else raw
+ def _raw(self, text):
+ return '*'+text
+
def dump(self):
l = range(len(self.texts)+1)
l[0] = '*'
==============================================================================
Revision: 604d6b6b52e9
Author: Mikko Korpela <[email protected]>
Date: Wed Jun 8 02:54:43 2011
Log: jsserializer: do not add empty message to status also fix unit
tests
http://code.google.com/p/robotframework/source/detail?r=604d6b6b52e9
Modified:
/src/robot/serializing/jsparser.py
/utest/resources/golden_suite/expected.js
/utest/serializing/test_js_serializer.py
=======================================
--- /src/robot/serializing/jsparser.py Wed Jun 8 02:49:11 2011
+++ /src/robot/serializing/jsparser.py Wed Jun 8 02:54:43 2011
@@ -413,10 +413,12 @@
self._endtime = self._context.timestamp(attrs.getValue('endtime'))
def end_element(self, text):
- return [self._status,
- self._starttime,
- self._endtime-self._starttime,
- self._context.get_text_id(text or '')]
+ result = [self._status,
+ self._starttime,
+ self._endtime-self._starttime]
+ if text:
+ result += [self._context.get_text_id(text)]
+ return result
class _TestStatusHandler(_StatusHandler):
=======================================
--- /utest/resources/golden_suite/expected.js Tue May 31 06:04:41 2011
+++ /utest/resources/golden_suite/expected.js Wed Jun 8 02:54:43 2011
@@ -1,3 +1,3 @@
window.basemillis = 1306835289053;
-window.data = [-40,"Robot trunk 20110527 (Python 2.6.5 on
linux2)",["suite","/tmp/data","Data",1,{"root":2},["setup",3,0,4,5,[0,"I",5],["P",0,1]],["suite","/tmp/data/all_settings.txt","All
Settings",6,{"meta":7,"version":8},["setup",3,0,4,9,[3,"I",9],["P",3,0]],["test",10,11,"Y",12,["setup",3,0,4,13,[5,"I",13],["P",4,2]],["kw",14,0,15,16,["kw",3,0,4,17,[8,"W",18],["P",7,3]],["teardown",3,0,4,19,[11,"I",19],["P",10,2]],["P",6,6]],["kw",14,0,15,20,["kw",3,0,4,17,[15,"I",21],["P",14,2]],["teardown",3,0,4,19,[17,"I",19],["P",16,2]],["P",13,6]],["teardown",3,0,4,22,[20,"I",22],["P",19,1]],[23,24],["P",4,16]],["teardown",3,0,4,25,[22,"I",25],["P",21,1]],["P",1,21],[1,0,1,0]],["suite","/tmp/data/failing_suite.txt","Failing
Suite",0,{},["test",26,0,"Y",0,["kw",27,0,28,29,[28,"F",29],["F",26,2]],[],["F",26,2]],["test",30,0,"Y",0,["kw",31,0,0,0,["kw",27,0,28,29,[31,"F",29],["F",30,1]],["F",29,2]],[],["F",29,2]],["test",32,0,"Y",0,["kw",33,0,0,0,[33,"F",34],["F",32,1]],[],["F",32,1]],["F",23,10],[3,0,3,0]],["teardown",27,0,28,0,[35,"F",35],["F",34,1]],["F",-27,62],[4,0,4,0]],[[["Critical
Tests",0,4,"","",""],["All
Tests",0,4,"","",""]],[["someothertag",0,1,"","",""],["sometag",0,1,"","",""]],[["Data",0,4,"Data","",""],["Data.All
Settings",0,1,"Data.All Settings","",""],["Data.Failing
Suite",0,3,"Data.Failing Suite","",""]]],[[8,"W",18,"keyword_Data.All
Settings.My test.1.0"],[25,"E",36],[25,"E",37]]];
-window.strings =["*","*root docs\nwith new line, several spaces \" \"
and a <b>bold tag</b>.","*rocks","*BuiltIn.Log","*Logs the given message
with the given level.","*Rock on","*Suite docs\nwith new line, several
spaces \" \" and a <b>bold tag</b>.","*rulez with
<b>escaped</b>","*alpha","*suite msg","*My test","*1 minute","*Test
docs\nwith new line, several spaces \" \" and a <b>bold tag</b>.","*Test
setup msg","*My kw","*Kw docs","*This is my _non html_ message\\nwith new
line, several spaces \" \\ \\ \\ \" and a <b>bold tag</b>.","*${arg},
${level}","*This is my _non html_ message\nwith new line, several spaces
\" \" and a <b>bold tag</b>.","*keyword teardown","*This is
my <blink>HTML</blink> message\\nwith new line, several spaces \" \\ \\ \\
\" and a <b>bold tag</b>., HTML","*This is my <blink>HTML</blink>
message\nwith new line, several spaces \" \" and a <b>bold
tag</b>.","*Test teardown msg","*someothertag","*sometag","*suite teardown
msg","*This fails at test","*BuiltIn.Fail","*Fails the test immediately
with the given (optional) message.","*Failure msg","*This fails at
kw","*Lets fail at keyword","*This Errors","*This does not exist","*No
keyword with name 'This does not exist'
found.","*AssertionError","eNqdlE1P20AQhu/5FSMuBineDRaUKBKHHloRqaKRyKWqkLX2DmaV9a61O6b2v2csE7VFCRiOM/PMO/v5rt2TskZD7B2pDoyDB2MREkl1I7UiJR+UscZVeWwNoaCOkoEiVQzYHRJxMSYrWNeND0MAhJHAmiKo0EOy1t4RdiZy46CFes9+C8GHFdx6qL1uWc6pGjX8bZhtfm1vft5uvm5vVvA7kW0M0vpSWcnqsunp0btMfJGa2bRR5U5VGGXwhSc5zjcYkzlM7VQteecjpgtxLi7SpmdEYFV9QIIw1JF6O2pcfkpjzOfDSrraslAmND7l4Xz5KbnalzsWuRKL4uCe/m09nJWNVZTyK2i77AjBUUq7N4re6jequnfWq2PEf/uZwsjN+sckruKAL2rxCh7fY3z3XF6J0S7NxLtaR7jDmn86Rpcpt2Rp60zpNU6/+qnHKZL72TaoEgtOwmnt+f8GLNER8AQLVkU6W80Avg/ecPKhf9iSsVGavTmIpj+Zszk4hOXlfHASfucu154IdT5iPAj2lnAN+Us2z08Hfzh7Br6ImA4=","*Invalid
syntax in file '/tmp/data/failing_suite.txt' in table 'Settings': Resource
file 'And I'm not here' does not exist."];
+window.data = [-40,"Robot trunk 20110527 (Python 2.6.5 on
linux2)",["suite","/tmp/data","Data",1,{"root":2},["setup",3,0,4,5,[0,"I",5],["P",0,1]],["suite","/tmp/data/all_settings.txt","All
Settings",6,{"meta":7,"version":8},["setup",3,0,4,9,[3,"I",9],["P",3,0]],["test",10,11,"Y",12,["setup",3,0,4,13,[5,"I",13],["P",4,2]],["kw",14,0,15,16,["kw",3,0,4,17,[8,"W",18],["P",7,3]],["teardown",3,0,4,19,[11,"I",19],["P",10,2]],["P",6,6]],["kw",14,0,15,20,["kw",3,0,4,17,[15,"I",21],["P",14,2]],["teardown",3,0,4,19,[17,"I",19],["P",16,2]],["P",13,6]],["teardown",3,0,4,22,[20,"I",22],["P",19,1]],[23,24],["P",4,16]],["teardown",3,0,4,25,[22,"I",25],["P",21,1]],["P",1,21],[1,0,1,0]],["suite","/tmp/data/failing_suite.txt","Failing
Suite",0,{},["test",26,0,"Y",0,["kw",27,0,28,29,[28,"F",29],["F",26,2]],[],["F",26,2,29]],["test",30,0,"Y",0,["kw",31,0,0,0,["kw",27,0,28,29,[31,"F",29],["F",30,1]],["F",29,2]],[],["F",29,2,29]],["test",32,0,"Y",0,["kw",33,0,0,0,[33,"F",34],["F",32,1]],[],["F",32,1,34]],["F",23,10],[3,0,3,0]],["teardown",27,0,28,0,[35,"F",35],["F",34,1]],["F",-27,62,36],[4,0,4,0]],[[["Critical
Tests",0,4,"","",""],["All
Tests",0,4,"","",""]],[["someothertag",0,1,"","",""],["sometag",0,1,"","",""]],[["Data",0,4,"Data","",""],["Data.All
Settings",0,1,"Data.All Settings","",""],["Data.Failing
Suite",0,3,"Data.Failing Suite","",""]]],[[8,"W",18,"keyword_Data.All
Settings.My test.1.0"],[25,"E",37],[25,"E",38]]];
+window.strings =["*","*root docs\nwith new line, several spaces \" \"
and a <b>bold tag</b>.","*rocks","*BuiltIn.Log","*Logs the given message
with the given level.","*Rock on","*Suite docs\nwith new line, several
spaces \" \" and a <b>bold tag</b>.","*rulez with
<b>escaped</b>","*alpha","*suite msg","*My test","*1 minute","*Test
docs\nwith new line, several spaces \" \" and a <b>bold tag</b>.","*Test
setup msg","*My kw","*Kw docs","*This is my _non html_ message\\nwith new
line, several spaces \" \\ \\ \\ \" and a <b>bold tag</b>.","*${arg},
${level}","*This is my _non html_ message\nwith new line, several spaces
\" \" and a <b>bold tag</b>.","*keyword teardown","*This is
my <blink>HTML</blink> message\\nwith new line, several spaces \" \\ \\ \\
\" and a <b>bold tag</b>., HTML","*This is my <blink>HTML</blink>
message\nwith new line, several spaces \" \" and a <b>bold
tag</b>.","*Test teardown msg","*someothertag","*sometag","*suite teardown
msg","*This fails at test","*BuiltIn.Fail","*Fails the test immediately
with the given (optional) message.","*Failure msg","*This fails at
kw","*Lets fail at keyword","*This Errors","*This does not exist","*No
keyword with name 'This does not exist' found.","*AssertionError","*Suite
teardown
failed:\nAssertionError","eNqdlE1P20AQhu/5FSMuBineDRaUKBKHHloRqaKRyKWqkLX2DmaV9a61O6b2v2csE7VFCRiOM/PMO/v5rt2TskZD7B2pDoyDB2MREkl1I7UiJR+UscZVeWwNoaCOkoEiVQzYHRJxMSYrWNeND0MAhJHAmiKo0EOy1t4RdiZy46CFes9+C8GHFdx6qL1uWc6pGjX8bZhtfm1vft5uvm5vVvA7kW0M0vpSWcnqsunp0btMfJGa2bRR5U5VGGXwhSc5zjcYkzlM7VQteecjpgtxLi7SpmdEYFV9QIIw1JF6O2pcfkpjzOfDSrraslAmND7l4Xz5KbnalzsWuRKL4uCe/m09nJWNVZTyK2i77AjBUUq7N4re6jequnfWq2PEf/uZwsjN+sckruKAL2rxCh7fY3z3XF6J0S7NxLtaR7jDmn86Rpcpt2Rp60zpNU6/+qnHKZL72TaoEgtOwmnt+f8GLNER8AQLVkU6W80Avg/ecPKhf9iSsVGavTmIpj+Zszk4hOXlfHASfucu154IdT5iPAj2lnAN+Us2z08Hfzh7Br6ImA4=","*Invalid
syntax in file '/tmp/data/failing_suite.txt' in table 'Settings': Resource
file 'And I'm not here' does not exist."];
=======================================
--- /utest/serializing/test_js_serializer.py Fri Jun 3 12:46:48 2011
+++ /utest/serializing/test_js_serializer.py Wed Jun 8 02:54:43 2011
@@ -26,6 +26,12 @@
assert_equals(data_model._robot_data, ['P',0,42])
assert_equals(data_model._texts, ['*'])
+ def test_status_with_message_xml_parsing(self):
+ data_model = self._get_data_model('<status status="PASS"
endtime="20110531 12:48:09.042" starttime="20110531
12:48:09.000">Message</status>')
+ assert_equals(data_model._basemillis, 1306835289000)
+ assert_equals(data_model._robot_data, ['P',0,42,1])
+ assert_equals(data_model._texts, ['*', '*Message'])
+
def test_tags_xml_parsing(self):
tags_xml = """
<tags>