2 new revisions:
Revision: 8560599e3edb
Author: Mikko Korpela <[email protected]>
Date: Wed Jun 15 01:08:49 2011
Log: generated time
http://code.google.com/p/robotframework/source/detail?r=8560599e3edb
Revision: b323426f43b9
Author: Mikko Korpela <[email protected]>
Date: Wed Jun 15 01:09:05 2011
Log: Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=b323426f43b9
==============================================================================
Revision: 8560599e3edb
Author: Mikko Korpela <[email protected]>
Date: Wed Jun 15 01:08:49 2011
Log: generated time
http://code.google.com/p/robotframework/source/detail?r=8560599e3edb
Modified:
/src/robot/serializing/elementhandlers.py
/src/robot/serializing/jsondatamodel.py
/src/robot/serializing/testoutput.py
/utest/serializing/test_js_serializer.py
=======================================
--- /src/robot/serializing/elementhandlers.py Tue Jun 14 23:16:01 2011
+++ /src/robot/serializing/elementhandlers.py Wed Jun 15 01:08:49 2011
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+from time import time
import zlib
import base64
=======================================
--- /src/robot/serializing/jsondatamodel.py Tue Jun 14 23:16:01 2011
+++ /src/robot/serializing/jsondatamodel.py Wed Jun 15 01:08:49 2011
@@ -11,6 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+import time
+from robot import utils
from elementhandlers import TextIndex
@@ -19,6 +21,10 @@
def __init__(self, robot_data):
self._robot_data = robot_data
+ def set_generated(self, timetuple):
+ self._robot_data['generatedMillis'] =
long(time.mktime(timetuple))*1000-self._robot_data['baseMillis']
+ self._robot_data['generatedTimestamp'] =
utils.format_time(timetuple, daytimesep=' ', gmtsep=' ')
+
def write_to(self, output):
output.write('window.output = ')
json_dump(self._robot_data, output)
=======================================
--- /src/robot/serializing/testoutput.py Tue Jun 14 22:30:07 2011
+++ /src/robot/serializing/testoutput.py Wed Jun 15 01:08:49 2011
@@ -80,6 +80,7 @@
def execute(self, settings, data_source):
data_model = jsparser.create_datamodel_from(data_source)
+ data_model.set_generated(time.localtime())
log_path = self._parse_file(settings['Log'])
report_path = self._parse_file(settings['Report'])
self._make_log(log_path, data_model, settings)
=======================================
--- /utest/serializing/test_js_serializer.py Tue Jun 14 23:16:01 2011
+++ /utest/serializing/test_js_serializer.py Wed Jun 15 01:08:49 2011
@@ -1,5 +1,7 @@
from __future__ import with_statement
import StringIO
+import time
+
try:
import json
except ImportError:
@@ -74,6 +76,11 @@
[-10, 'F', 2],
['F', 0, -10]], ['*', '*KwName', '*AssertionError'])
+ def test_generated_millis(self):
+ self._context.timestamp('19790101 12:00:00.000')
+ data_model = self._get_data_model(self.SUITE_XML)
+ data_model.set_generated(time.localtime(284029200))
+ assert_equals(data_model._robot_data['generatedMillis'], 0)
def test_tags_xml_parsing(self):
tags_xml = """
==============================================================================
Revision: b323426f43b9
Author: Mikko Korpela <[email protected]>
Date: Wed Jun 15 01:09:05 2011
Log: Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=b323426f43b9
Modified:
/src/robot/serializing/testoutput.py
=======================================
--- /src/robot/serializing/testoutput.py Wed Jun 15 00:12:06 2011
+++ /src/robot/serializing/testoutput.py Wed Jun 15 01:09:05 2011
@@ -80,6 +80,7 @@
def execute(self, settings, data_source):
data_model = jsparser.create_datamodel_from(data_source)
+ data_model.set_generated(time.localtime())
log_path = self._parse_file(settings['Log'])
report_path = self._parse_file(settings['Report'])
self._make_log(log_path, data_model, settings)