当前位置: 首页>>代码示例>>Python>>正文


Python DocumentIO.dumps方法代码示例

本文整理汇总了Python中linaro_dashboard_bundle.io.DocumentIO.dumps方法的典型用法代码示例。如果您正苦于以下问题:Python DocumentIO.dumps方法的具体用法?Python DocumentIO.dumps怎么用?Python DocumentIO.dumps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在linaro_dashboard_bundle.io.DocumentIO的用法示例。


在下文中一共展示了DocumentIO.dumps方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: invoke_sub

# 需要导入模块: from linaro_dashboard_bundle.io import DocumentIO [as 别名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 别名]
 def invoke_sub(self):
     bundle = generate_combined_bundle(self.args.serial,
                                       self.args.result_id)
     try:
         print DocumentIO.dumps(bundle)
     except IOError:
         pass
开发者ID:inwotep,项目名称:lava-android-test,代码行数:9,代码来源:commands.py

示例2: _savetestdata

# 需要导入模块: from linaro_dashboard_bundle.io import DocumentIO [as 别名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 别名]
 def _savetestdata(self, analyzer_assigned_uuid, run_options=""):
     config = get_config()
     TIMEFORMAT = '%Y-%m-%dT%H:%M:%SZ'
     bundle = {
         'format': config.bundle_format,
         'test_runs': [
             {
             'analyzer_assigned_uuid': analyzer_assigned_uuid,
             'analyzer_assigned_date':
                     self.runner.starttime.strftime(TIMEFORMAT),
             'time_check_performed': False,
             'attributes':{},
             'test_id': self.testname,
             'test_results':[],
             'attachments':[],
             'hardware_context': hwprofile.get_hardware_context(self.adb),
             'software_context': swprofile.get_software_context(self.adb)
             }
         ]
     }
     if run_options:
         bundle['test_runs'][0]['attributes']['run_options'] = run_options
     self._add_install_options(bundle, config)
     filename_host = os.path.join(config.tempdir_host, 'testdata.json')
     write_file(DocumentIO.dumps(bundle), filename_host)
     filename_target = os.path.join(self.resultsdir, 'testdata.json')
     self.adb.push(filename_host, filename_target)
开发者ID:inwotep,项目名称:lava-android-test,代码行数:29,代码来源:testdef.py

示例3: test_load_and_save_does_not_clobber_the_data

# 需要导入模块: from linaro_dashboard_bundle.io import DocumentIO [as 别名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 别名]
 def test_load_and_save_does_not_clobber_the_data(self):
     original_text = resource_string(
         'linaro_dashboard_bundle', 'test_documents/' +
         self.filename)
     fmt, doc = DocumentIO.loads(original_text)
     final_text = DocumentIO.dumps(doc,)
     final_text += "\n"  # the original string has newline at the end
     self.assertEqual(final_text, original_text)
开发者ID:Bruce-Zou,项目名称:lava-dispatcher,代码行数:10,代码来源:tests.py

示例4: submit_bundle

# 需要导入模块: from linaro_dashboard_bundle.io import DocumentIO [as 别名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 别名]
 def submit_bundle(self, main_bundle, server, stream, token):
     dashboard = _get_dashboard(server, token)
     json_bundle = DocumentIO.dumps(main_bundle)
     job_name = self.context.job_data.get('job_name', "LAVA Results")
     try:
         result = dashboard.put_ex(json_bundle, job_name, stream)
         print >> self.context.oob_file, 'dashboard-put-result:', result
         self.context.output.write_named_data('result-bundle', result)
         logging.info("Dashboard : %s" % result)
     except xmlrpclib.Fault, err:
         logging.warning("xmlrpclib.Fault occurred")
         logging.warning("Fault code: %d" % err.faultCode)
         logging.warning("Fault string: %s" % err.faultString)
         raise OperationFailed("could not push to dashboard")
开发者ID:inwotep,项目名称:lava-dispatcher,代码行数:16,代码来源:launch_control.py

示例5: test_dumper_can_dump_decimals

# 需要导入模块: from linaro_dashboard_bundle.io import DocumentIO [as 别名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 别名]
 def test_dumper_can_dump_decimals(self):
     doc = {
         "format": "Dashboard Bundle Format 1.0",
         "test_runs": [
             {
                 "test_id": "NOT RELEVANT",
                 "analyzer_assigned_date": "2010-11-14T01:03:06Z",
                 "analyzer_assigned_uuid": "NOT RELEVANT",
                 "time_check_performed": False,
                 "test_results": [
                     {
                         "test_case_id": "NOT RELEVANT",
                         "result": "unknown",
                         "measurement": Decimal("1.5")
                     }
                 ]
             }
         ]
     }
     text = DocumentIO.dumps(doc)
     self.assertIn("1.5", text)
开发者ID:Bruce-Zou,项目名称:lava-dispatcher,代码行数:23,代码来源:tests.py

示例6: test_dumps_produces_compact_sorted_ouptut

# 需要导入模块: from linaro_dashboard_bundle.io import DocumentIO [as 别名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 别名]
 def test_dumps_produces_compact_sorted_ouptut(self):
     observed_text = DocumentIO.dumps(self.doc, human_readable=False, sort_keys=True)
     self.assertEqual(observed_text, self.expected_compact_sorted_text)
开发者ID:Bruce-Zou,项目名称:lava-dispatcher,代码行数:5,代码来源:tests.py

示例7: test_dumps_produces_readable_ouptut

# 需要导入模块: from linaro_dashboard_bundle.io import DocumentIO [as 别名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 别名]
 def test_dumps_produces_readable_ouptut(self):
     observed_text = DocumentIO.dumps(self.doc, human_readable=True)
     self.assertEqual(observed_text, self.expected_readable_text)
开发者ID:Bruce-Zou,项目名称:lava-dispatcher,代码行数:5,代码来源:tests.py


注:本文中的linaro_dashboard_bundle.io.DocumentIO.dumps方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。